Web platform tests for Web Share API fail incorrectly
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Feb 2020 05:22:46 +0000 (05:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Feb 2020 05:22:46 +0000 (05:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208083

Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-02-26
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Fixed expected for updated wpts.

* web-platform-tests/web-share/share-without-user-gesture.https-expected.txt:
* web-platform-tests/web-share/canShare-files.https-expected.txt:
* web-platform-tests/web-share/canShare.https-expected.txt:
* web-platform-tests/web-share/idlharness.https.window-expected.txt:

LayoutTests:

Removed duplicate tests for corresponding wpts, fixed expected
for new wpts. Modified TestExpectations to now run all web-share
wpts except for those testing secure context behavior, which is not
supported by the current wpt infrastructure.

* TestExpectations:
* fast/web-share/canShare-expected.txt: Removed.
* fast/web-share/canShare-files-expected.txt: Removed.
* fast/web-share/canShare-files.html: Removed.
* fast/web-share/canShare.html: Removed.
* fast/web-share/share-empty-expected.txt: Removed.
* fast/web-share/share-empty.html: Removed.
* fast/web-share/share-url-invalid-expected.txt: Removed.
* fast/web-share/share-without-user-gesture-expected.txt: Removed.
* fast/web-share/share-without-user-gesture.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257556 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/web-share/canShare-expected.txt [deleted file]
LayoutTests/fast/web-share/canShare-files-expected.txt [deleted file]
LayoutTests/fast/web-share/canShare-files.html [deleted file]
LayoutTests/fast/web-share/canShare.html [deleted file]
LayoutTests/fast/web-share/share-empty-expected.txt [deleted file]
LayoutTests/fast/web-share/share-empty.html [deleted file]
LayoutTests/fast/web-share/share-url-invalid-expected.txt [deleted file]
LayoutTests/fast/web-share/share-without-user-gesture-expected.txt [deleted file]
LayoutTests/fast/web-share/share-without-user-gesture.html [deleted file]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/web-share/canShare-files.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/web-share/canShare.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/web-share/idlharness.https.window-expected.txt
LayoutTests/imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https-expected.txt

index 52f7707..40b4636 100644 (file)
@@ -1,3 +1,26 @@
+2020-02-26  Nikos Mouchtaris  <nmouchtaris@apple.com>
+
+        Web platform tests for Web Share API fail incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=208083
+
+        Reviewed by Alex Christensen.
+
+        Removed duplicate tests for corresponding wpts, fixed expected
+        for new wpts. Modified TestExpectations to now run all web-share
+        wpts except for those testing secure context behavior, which is not
+        supported by the current wpt infrastructure.
+
+        * TestExpectations:
+        * fast/web-share/canShare-expected.txt: Removed.
+        * fast/web-share/canShare-files-expected.txt: Removed.
+        * fast/web-share/canShare-files.html: Removed.
+        * fast/web-share/canShare.html: Removed.
+        * fast/web-share/share-empty-expected.txt: Removed.
+        * fast/web-share/share-empty.html: Removed.
+        * fast/web-share/share-url-invalid-expected.txt: Removed.
+        * fast/web-share/share-without-user-gesture-expected.txt: Removed.
+        * fast/web-share/share-without-user-gesture.html: Removed.
+
 2020-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [iPadOS] REGRESSION(r247667): Autosizing style changes don't invalidate RenderText's preferred logical widths
index e1b577d..64ccd5d 100644 (file)
@@ -738,14 +738,6 @@ imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker
 imported/w3c/web-platform-tests/web-share/canShare-insecure.http.html
 imported/w3c/web-platform-tests/web-share/share-securecontext.http.html
 
-# Web platform tests produce wrong failing results- https://bugs.webkit.org/show_bug.cgi?id=208083
-imported/w3c/web-platform-tests/web-share/idlharness.https.window.html
-imported/w3c/web-platform-tests/web-share/share-empty.https.html
-imported/w3c/web-platform-tests/web-share/share-url-invalid.https.html
-imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https.html
-imported/w3c/web-platform-tests/web-share/canShare.https.html
-imported/w3c/web-platform-tests/web-share/canShare-files.https.html
-
 # Only relevant on macOS
 css3/color-filters/punch-out-white-backgrounds.html [ Skip ]
 
diff --git a/LayoutTests/fast/web-share/canShare-expected.txt b/LayoutTests/fast/web-share/canShare-expected.txt
deleted file mode 100644 (file)
index 3d1fb51..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-
-PASS canShare with no arguments (same as empty dictionary) 
-PASS canShare with an empty dictionary 
-PASS canShare with a undefined argument (same as empty dictionary) 
-PASS canShare with a null argument (same as empty dictionary) 
-PASS canShare with a dictionary containing only surplus fields 
-PASS canShare with an invalid URL 
-PASS canShare with attribute undefined is equivalent to omitting the attribute 
-PASS canShare with title 
-PASS canShare with text 
-PASS canShare with URL 
-PASS canShare with null attribute 
-PASS canShare with number 
-PASS canShare with object 
-PASS canShare with unexpected field 
-PASS canShare with data URL 
-PASS canShare with empty URL 
-PASS canShare with URL having no scheme 
-
diff --git a/LayoutTests/fast/web-share/canShare-files-expected.txt b/LayoutTests/fast/web-share/canShare-files-expected.txt
deleted file mode 100644 (file)
index 4a477fc..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-
-FAIL canShare with single file Can't find variable: assert_throws_js
-PASS canShare with empty file list 
-FAIL canShare with single file list assert_equals: expected true but got false
-FAIL canShare with file list assert_equals: expected true but got false
-FAIL canShare with repeated file assert_equals: expected true but got false
-PASS canShare with file list and url 
-
diff --git a/LayoutTests/fast/web-share/canShare-files.html b/LayoutTests/fast/web-share/canShare-files.html
deleted file mode 100644 (file)
index c56e3c1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<head>
-    <title>PointerLock interface tests.</title>
-    <script src="../../resources/testharness.js"></script>
-    <script src="../../resources/testharnessreport.js"></script>
-    <script src="../../resources/ui-helper.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-const textFile = new File(['hello'], 'hello.txt', {type:'text/plain'});
-const emptyFile = new File([''], 'empty');
-
-test(() => {
-assert_throws_js(TypeError, () => { navigator.canShare({files: textFile}) });
-}, 'canShare with single file');
-
-test(() => {
-assert_equals(navigator.canShare({files: []}), false);
-}, 'canShare with empty file list');
-
-test(() => {
-assert_equals(navigator.canShare({files: [emptyFile]}), true);
-}, 'canShare with single file list');
-
-test(() => {
-assert_equals(navigator.canShare({files: [textFile, emptyFile]}), true);
-}, 'canShare with file list');
-
-test(() => {
-assert_equals(navigator.canShare({files: [textFile, emptyFile, textFile]}), true);
-}, 'canShare with repeated file');
-
-test(() => {
-assert_equals(navigator.canShare({url: 'https://example.com/', files: [textFile, emptyFile]}), true);
-}, 'canShare with file list and url');
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/web-share/canShare.html b/LayoutTests/fast/web-share/canShare.html
deleted file mode 100644 (file)
index f02f40d..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<head>
-    <title>PointerLock interface tests.</title>
-    <script src="../../resources/testharness.js"></script>
-    <script src="../../resources/testharnessreport.js"></script>
-    <script src="../../resources/ui-helper.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-      test(() => {
-        assert_equals(navigator.canShare(), false);
-      }, 'canShare with no arguments (same as empty dictionary)');
-
-      test(() => {
-        assert_equals(navigator.canShare({}), false);
-      }, 'canShare with an empty dictionary');
-
-      test(() => {
-        assert_equals(navigator.canShare(undefined), false);
-      }, 'canShare with a undefined argument (same as empty dictionary)');
-
-      test(() => {
-        assert_equals(navigator.canShare(null), false);
-      }, 'canShare with a null argument (same as empty dictionary)');
-
-      test(() => {
-        assert_equals(navigator.canShare({unused: 'unexpected field'}), false);
-      }, 'canShare with a dictionary containing only surplus fields');
-
-      test(() => {
-        // URL is invalid in that the URL Parser returns failure (port is too
-        // large).
-        const url = 'http://example.com:65536';
-        assert_equals(navigator.canShare({url}), false);
-      }, 'canShare with an invalid URL');
-
-      test(() => {
-        assert_equals(navigator.canShare({title: undefined}), false);
-      }, 'canShare with attribute undefined is equivalent to omitting the attribute');
-
-      test(() => {
-        assert_equals(navigator.canShare({title: 'subject'}), true);
-      }, 'canShare with title');
-
-      test(() => {
-        assert_equals(navigator.canShare({text: 'body'}), true);
-      }, 'canShare with text');
-
-      test(() => {
-        assert_equals(navigator.canShare({url: 'https://www.example.com/some/path?some_query#some_fragment'}), true);
-      }, 'canShare with URL');
-
-      test(() => {
-        assert_equals(navigator.canShare({title: null}), true);
-      }, 'canShare with null attribute');
-
-      test(() => {
-        assert_equals(navigator.canShare({text: 123}), true);
-      }, 'canShare with number');
-
-      test(() => {
-        assert_equals(navigator.canShare({url: {toString() { return 'https://example.com/'; }}}), true);
-      }, 'canShare with object');
-
-      test(() => {
-        assert_equals(navigator.canShare({title: 'subject', text: 'body', url: 'https://example.com/', unused: 'unexpected field'}), true);
-      }, 'canShare with unexpected field');
-
-      test(() => {
-        assert_equals(navigator.canShare({url: 'data:the url'}), true);
-      }, 'canShare with data URL');
-
-      test(() => {
-        assert_equals(navigator.canShare({url: ''}), true);
-      }, 'canShare with empty URL');
-
-      test(() => {
-        assert_equals(navigator.canShare({url: '//www.example.com/some/path?some_query#some_fragment'}), true);
-      }, 'canShare with URL having no scheme');
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/web-share/share-empty-expected.txt b/LayoutTests/fast/web-share/share-empty-expected.txt
deleted file mode 100644 (file)
index 57d3291..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-PASS share with no arguments (same as empty dictionary) 
-PASS share with an empty dictionary 
-PASS share with a undefined argument (same as empty dictionary) 
-PASS share with a null argument (same as empty dictionary) 
-PASS share with a dictionary containing only surplus fields 
-
diff --git a/LayoutTests/fast/web-share/share-empty.html b/LayoutTests/fast/web-share/share-empty.html
deleted file mode 100644 (file)
index 69a74ee..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<head>
-    <title>PointerLock interface tests.</title>
-    <script src="../../resources/testharness.js"></script>
-    <script src="../../resources/testharnessreport.js"></script>
-    <script src="../../resources/ui-helper.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-promise_test(t => {
-    return promise_rejects(t,  new TypeError(), navigator.share());
-}, 'share with no arguments (same as empty dictionary)');
-
-promise_test(t => {
-    return promise_rejects(t,  new TypeError(), navigator.share({}));
-}, 'share with an empty dictionary');
-
-promise_test(t => {
-    return promise_rejects(t,  new TypeError(), navigator.share(undefined));
-}, 'share with a undefined argument (same as empty dictionary)');
-
-promise_test(t => {
-    return promise_rejects(t,  new TypeError(), navigator.share(null));
-}, 'share with a null argument (same as empty dictionary)');
-
-promise_test(t => {
-    return promise_rejects(t,
-    new TypeError(), navigator.share({unused: 'unexpected field'}));
-}, 'share with a dictionary containing only surplus fields');
-
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/web-share/share-url-invalid-expected.txt b/LayoutTests/fast/web-share/share-url-invalid-expected.txt
deleted file mode 100644 (file)
index 61e89de..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-PASS share with an invalid URL 
-PASS share with an empty dictionary 
-PASS share with a undefined argument (same as empty dictionary) 
-PASS share with a null argument (same as empty dictionary) 
-PASS share with a dictionary containing only surplus fields 
-
diff --git a/LayoutTests/fast/web-share/share-without-user-gesture-expected.txt b/LayoutTests/fast/web-share/share-without-user-gesture-expected.txt
deleted file mode 100644 (file)
index 1ddfa67..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS share without a user gesture 
-
diff --git a/LayoutTests/fast/web-share/share-without-user-gesture.html b/LayoutTests/fast/web-share/share-without-user-gesture.html
deleted file mode 100644 (file)
index 5450508..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
-<head>
-    <title>PointerLock interface tests.</title>
-    <script src="../../resources/testharness.js"></script>
-    <script src="../../resources/testharnessreport.js"></script>
-    <script src="../../resources/ui-helper.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-promise_test(t => {
-    return promise_rejects(
-              t, 'NotAllowedError',
-              navigator.share({title: 'the title', text: 'the message',
-                               url: 'https://example.com'}));
-}, 'share without a user gesture');
-
-</script>
-</body>
-</html>
index 7f54fae..94c4c58 100644 (file)
@@ -1,3 +1,17 @@
+2020-02-26  Nikos Mouchtaris  <nmouchtaris@apple.com>
+
+        Web platform tests for Web Share API fail incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=208083
+
+        Reviewed by Alex Christensen.
+
+        Fixed expected for updated wpts.
+
+        * web-platform-tests/web-share/share-without-user-gesture.https-expected.txt:
+        * web-platform-tests/web-share/canShare-files.https-expected.txt:
+        * web-platform-tests/web-share/canShare.https-expected.txt:
+        * web-platform-tests/web-share/idlharness.https.window-expected.txt:
+
 2020-02-24  Nikos Mouchtaris  <nmouchtaris@apple.com>
 
         Add canShare function for Web Share API v2
index 2d99c92..e68b307 100644 (file)
@@ -1,8 +1,8 @@
 
 PASS canShare with single file 
-PASS canShare with empty file list 
-FAIL canShare with single file list assert_equals: expected true but got false
-FAIL canShare with file list assert_equals: expected true but got false
-FAIL canShare with repeated file assert_equals: expected true but got false
-PASS canShare with file list and url 
+FAIL canShare with empty file list navigator.canShare is not a function. (In 'navigator.canShare({files: []})', 'navigator.canShare' is undefined)
+FAIL canShare with single file list navigator.canShare is not a function. (In 'navigator.canShare({files: [emptyFile]})', 'navigator.canShare' is undefined)
+FAIL canShare with file list navigator.canShare is not a function. (In 'navigator.canShare({files: [textFile, emptyFile]})', 'navigator.canShare' is undefined)
+FAIL canShare with repeated file navigator.canShare is not a function. (In 'navigator.canShare({files: [textFile, emptyFile, textFile]})', 'navigator.canShare' is undefined)
+FAIL canShare with file list and url navigator.canShare is not a function. (In 'navigator.canShare({url: 'https://example.com/', files: [textFile, emptyFile]})', 'navigator.canShare' is undefined)
 
index 3d1fb51..cc6a443 100644 (file)
@@ -1,19 +1,19 @@
 
-PASS canShare with no arguments (same as empty dictionary) 
-PASS canShare with an empty dictionary 
-PASS canShare with a undefined argument (same as empty dictionary) 
-PASS canShare with a null argument (same as empty dictionary) 
-PASS canShare with a dictionary containing only surplus fields 
-PASS canShare with an invalid URL 
-PASS canShare with attribute undefined is equivalent to omitting the attribute 
-PASS canShare with title 
-PASS canShare with text 
-PASS canShare with URL 
-PASS canShare with null attribute 
-PASS canShare with number 
-PASS canShare with object 
-PASS canShare with unexpected field 
-PASS canShare with data URL 
-PASS canShare with empty URL 
-PASS canShare with URL having no scheme 
+FAIL canShare with no arguments (same as empty dictionary) navigator.canShare is not a function. (In 'navigator.canShare()', 'navigator.canShare' is undefined)
+FAIL canShare with an empty dictionary navigator.canShare is not a function. (In 'navigator.canShare({})', 'navigator.canShare' is undefined)
+FAIL canShare with a undefined argument (same as empty dictionary) navigator.canShare is not a function. (In 'navigator.canShare(undefined)', 'navigator.canShare' is undefined)
+FAIL canShare with a null argument (same as empty dictionary) navigator.canShare is not a function. (In 'navigator.canShare(null)', 'navigator.canShare' is undefined)
+FAIL canShare with a dictionary containing only surplus fields navigator.canShare is not a function. (In 'navigator.canShare({unused: 'unexpected field'})', 'navigator.canShare' is undefined)
+FAIL canShare with an invalid URL navigator.canShare is not a function. (In 'navigator.canShare({url})', 'navigator.canShare' is undefined)
+FAIL canShare with attribute undefined is equivalent to omitting the attribute navigator.canShare is not a function. (In 'navigator.canShare({title: undefined})', 'navigator.canShare' is undefined)
+FAIL canShare with title navigator.canShare is not a function. (In 'navigator.canShare({title: 'subject'})', 'navigator.canShare' is undefined)
+FAIL canShare with text navigator.canShare is not a function. (In 'navigator.canShare({text: 'body'})', 'navigator.canShare' is undefined)
+FAIL canShare with URL navigator.canShare is not a function. (In 'navigator.canShare({url: 'https://www.example.com/some/path?some_query#some_fragment'})', 'navigator.canShare' is undefined)
+FAIL canShare with null attribute navigator.canShare is not a function. (In 'navigator.canShare({title: null})', 'navigator.canShare' is undefined)
+FAIL canShare with number navigator.canShare is not a function. (In 'navigator.canShare({text: 123})', 'navigator.canShare' is undefined)
+FAIL canShare with object navigator.canShare is not a function. (In 'navigator.canShare({url: {toString() { return 'https://example.com/'; }}})', 'navigator.canShare' is undefined)
+FAIL canShare with unexpected field navigator.canShare is not a function. (In 'navigator.canShare({title: 'subject', text: 'body', url: 'https://example.com/', unused: 'unexpected field'})', 'navigator.canShare' is undefined)
+FAIL canShare with data URL navigator.canShare is not a function. (In 'navigator.canShare({url: 'data:the url'})', 'navigator.canShare' is undefined)
+FAIL canShare with empty URL navigator.canShare is not a function. (In 'navigator.canShare({url: ''})', 'navigator.canShare' is undefined)
+FAIL canShare with URL having no scheme navigator.canShare is not a function. (In 'navigator.canShare({url: '//www.example.com/some/path?some_query#some_fragment'})', 'navigator.canShare' is undefined)
 
index 01699ec..52ea882 100644 (file)
@@ -11,7 +11,7 @@ PASS Navigator includes NavigatorContentUtils: member names are unique
 PASS Navigator includes NavigatorCookies: member names are unique 
 PASS Navigator includes NavigatorPlugins: member names are unique 
 PASS Navigator includes NavigatorConcurrentHardware: member names are unique 
-PASS Navigator interface: operation share(ShareData) 
-PASS Navigator interface: navigator must inherit property "share(ShareData)" with the proper type 
-PASS Navigator interface: calling share(ShareData) on navigator with too few arguments must throw TypeError 
+FAIL Navigator interface: operation share(ShareData) assert_own_property: interface prototype object missing non-static operation expected property "share" missing
+FAIL Navigator interface: navigator must inherit property "share(ShareData)" with the proper type assert_inherits: property "share" not found in prototype chain
+FAIL Navigator interface: calling share(ShareData) on navigator with too few arguments must throw TypeError assert_inherits: property "share" not found in prototype chain
 
index 34926c1..0017f72 100644 (file)
@@ -1,4 +1,4 @@
 
 FAIL share without a user gesture navigator.share is not a function. (In 'navigator.share({title: 'the title', text: 'the message',
-                               url: 'data:the url'})', 'navigator.share' is undefined)
+                               url: 'https://example.com'})', 'navigator.share' is undefined)