Title: [281447] trunk/LayoutTests/imported/w3c
Revision
281447
Author
[email protected]
Date
2021-08-23 09:01:29 -0700 (Mon, 23 Aug 2021)

Log Message

Import permissions tests from WPT
https://bugs.webkit.org/show_bug.cgi?id=229349

Reviewed by Chris Dumez.

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/permissions/META.yml: Added.
* web-platform-tests/permissions/feature-policy-permissions-query.html: Added.
* web-platform-tests/permissions/idlharness.any-expected.txt: Added.
* web-platform-tests/permissions/idlharness.any.html: Added.
* web-platform-tests/permissions/idlharness.any.js: Added.
(async idl_array):
* web-platform-tests/permissions/idlharness.any.worker-expected.txt: Added.
* web-platform-tests/permissions/idlharness.any.worker.html: Added.
* web-platform-tests/permissions/nfc-permission-expected.txt: Added.
* web-platform-tests/permissions/nfc-permission.html: Added.
* web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub-expected.txt: Added.
* web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html: Added.
* web-platform-tests/permissions/permissionsstatus-name-expected.txt: Added.
* web-platform-tests/permissions/permissionsstatus-name.html: Added.
* web-platform-tests/permissions/screen-wake-lock-permission-expected.txt: Added.
* web-platform-tests/permissions/screen-wake-lock-permission.html: Added.
* web-platform-tests/permissions/test-background-fetch-permission-expected.txt: Added.
* web-platform-tests/permissions/test-background-fetch-permission.html: Added.
* web-platform-tests/permissions/test-periodic-background-sync-permission-expected.txt: Added.
* web-platform-tests/permissions/test-periodic-background-sync-permission.html: Added.
* web-platform-tests/permissions/w3c-import.log: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (281446 => 281447)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-23 15:11:36 UTC (rev 281446)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-23 16:01:29 UTC (rev 281447)
@@ -1,3 +1,34 @@
+2021-08-23  Sihui Liu  <[email protected]>
+
+        Import permissions tests from WPT
+        https://bugs.webkit.org/show_bug.cgi?id=229349
+
+        Reviewed by Chris Dumez.
+
+        * resources/import-expectations.json:
+        * resources/resource-files.json:
+        * web-platform-tests/permissions/META.yml: Added.
+        * web-platform-tests/permissions/feature-policy-permissions-query.html: Added.
+        * web-platform-tests/permissions/idlharness.any-expected.txt: Added.
+        * web-platform-tests/permissions/idlharness.any.html: Added.
+        * web-platform-tests/permissions/idlharness.any.js: Added.
+        (async idl_array):
+        * web-platform-tests/permissions/idlharness.any.worker-expected.txt: Added.
+        * web-platform-tests/permissions/idlharness.any.worker.html: Added.
+        * web-platform-tests/permissions/nfc-permission-expected.txt: Added.
+        * web-platform-tests/permissions/nfc-permission.html: Added.
+        * web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub-expected.txt: Added.
+        * web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html: Added.
+        * web-platform-tests/permissions/permissionsstatus-name-expected.txt: Added.
+        * web-platform-tests/permissions/permissionsstatus-name.html: Added.
+        * web-platform-tests/permissions/screen-wake-lock-permission-expected.txt: Added.
+        * web-platform-tests/permissions/screen-wake-lock-permission.html: Added.
+        * web-platform-tests/permissions/test-background-fetch-permission-expected.txt: Added.
+        * web-platform-tests/permissions/test-background-fetch-permission.html: Added.
+        * web-platform-tests/permissions/test-periodic-background-sync-permission-expected.txt: Added.
+        * web-platform-tests/permissions/test-periodic-background-sync-permission.html: Added.
+        * web-platform-tests/permissions/w3c-import.log: Added.
+
 2021-08-23  Martin Robinson  <[email protected]>
 
         Sticky position should not use transformed position to compute sticky offset.

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (281446 => 281447)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2021-08-23 15:11:36 UTC (rev 281446)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2021-08-23 16:01:29 UTC (rev 281447)
@@ -370,6 +370,7 @@
     "web-platform-tests/payment-method-id": "skip", 
     "web-platform-tests/payment-request": "import", 
     "web-platform-tests/performance-timeline": "skip", 
+    "web-platform-tests/permissions": "import", 
     "web-platform-tests/picture-in-picture": "import", 
     "web-platform-tests/pointerevents": "import", 
     "web-platform-tests/pointerlock": "skip", 

Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (281446 => 281447)


--- trunk/LayoutTests/imported/w3c/resources/resource-files.json	2021-08-23 15:11:36 UTC (rev 281446)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json	2021-08-23 16:01:29 UTC (rev 281447)
@@ -2796,6 +2796,7 @@
         "web-platform-tests/payment-request/blank.html",
         "web-platform-tests/payment-request/payment-request-response-id.html",
         "web-platform-tests/payment-request/show-method-postmessage-iframe.html",
+        "web-platform-tests/permissions/feature-policy-permissions-query.html",
         "web-platform-tests/resource-timing/iframe-setdomain.sub.html",
         "web-platform-tests/secure-contexts/postMessage-helper.html",
         "web-platform-tests/secure-contexts/postMessage-helper.https.html",

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/META.yml (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/META.yml	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/META.yml	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,5 @@
+spec: https://w3c.github.io/permissions/
+suggested_reviewers:
+  - jyasskin
+  - mounirlamouri
+  - marcoscaceres

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/feature-policy-permissions-query.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/feature-policy-permissions-query.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/feature-policy-permissions-query.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,11 @@
+<script>
+'use strict';
+
+Promise.resolve().then(() => navigator.permissions.query({name:'geolocation'}))
+  .then(permissionStatus => {
+  window.parent.postMessage({ state: permissionStatus.state }, '*');
+}, error => {
+  window.parent.postMessage({ state: null }, '*');
+});
+</script>
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,47 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface Navigator: original interface defined
+PASS Partial interface Navigator: valid exposure set
+PASS Partial interface Navigator: member names are unique
+PASS Partial interface WorkerNavigator: original interface defined
+PASS Partial interface WorkerNavigator: valid exposure set
+PASS Partial interface WorkerNavigator: member names are unique
+PASS Partial interface mixin NavigatorID: member names are unique
+PASS Navigator includes NavigatorID: member names are unique
+PASS Navigator includes NavigatorLanguage: member names are unique
+PASS Navigator includes NavigatorOnLine: member names are unique
+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 WorkerNavigator includes NavigatorID: member names are unique
+PASS WorkerNavigator includes NavigatorLanguage: member names are unique
+PASS WorkerNavigator includes NavigatorOnLine: member names are unique
+PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique
+FAIL PermissionStatus interface: existence and properties of interface object assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface object length assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface object name assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: attribute state assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: attribute onchange assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus must be primary interface of permissionStatus assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL Stringification of permissionStatus assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL PermissionStatus interface: permissionStatus must inherit property "state" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL PermissionStatus interface: permissionStatus must inherit property "onchange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL Permissions interface: existence and properties of interface object assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface object length assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface object name assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: operation query(object) assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions must be primary interface of navigator.permissions assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.permissions assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Permissions interface: navigator.permissions must inherit property "query(object)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Permissions interface: calling query(object) on navigator.permissions with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Navigator interface: attribute permissions assert_true: The prototype object must have a property "permissions" expected true got false
+FAIL Navigator interface: navigator must inherit property "permissions" with the proper type assert_inherits: property "permissions" not found in prototype chain
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.js (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.js	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.js	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,27 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+// https://w3c.github.io/permissions/#idl-index
+
+"use strict";
+
+idl_test(
+  ['permissions'],
+  ['html', 'dom'],
+  async idl_array => {
+    try {
+      self.permissionStatus = await navigator.permissions.query({ name: "geolocation" });
+    } catch (e) {}
+
+    if (self.GLOBAL.isWorker()) {
+      idl_array.add_objects({ WorkerNavigator: ['navigator'] });
+    } else {
+      idl_array.add_objects({ Navigator: ['navigator'] });
+    }
+
+    idl_array.add_objects({
+      Permissions: ['navigator.permissions'],
+      PermissionStatus: ['permissionStatus']
+    });
+  }
+);

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,47 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface Navigator: original interface defined
+PASS Partial interface Navigator: valid exposure set
+PASS Partial interface Navigator: member names are unique
+PASS Partial interface WorkerNavigator: original interface defined
+PASS Partial interface WorkerNavigator: valid exposure set
+PASS Partial interface WorkerNavigator: member names are unique
+PASS Partial interface mixin NavigatorID: member names are unique
+PASS Navigator includes NavigatorID: member names are unique
+PASS Navigator includes NavigatorLanguage: member names are unique
+PASS Navigator includes NavigatorOnLine: member names are unique
+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 WorkerNavigator includes NavigatorID: member names are unique
+PASS WorkerNavigator includes NavigatorLanguage: member names are unique
+PASS WorkerNavigator includes NavigatorOnLine: member names are unique
+PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique
+FAIL PermissionStatus interface: existence and properties of interface object assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface object length assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface object name assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: attribute state assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus interface: attribute onchange assert_own_property: self does not have own property "PermissionStatus" expected property "PermissionStatus" missing
+FAIL PermissionStatus must be primary interface of permissionStatus assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL Stringification of permissionStatus assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL PermissionStatus interface: permissionStatus must inherit property "state" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL PermissionStatus interface: permissionStatus must inherit property "onchange" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: permissionStatus"
+FAIL Permissions interface: existence and properties of interface object assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface object length assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface object name assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions interface: operation query(object) assert_own_property: self does not have own property "Permissions" expected property "Permissions" missing
+FAIL Permissions must be primary interface of navigator.permissions assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.permissions assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Permissions interface: navigator.permissions must inherit property "query(object)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Permissions interface: calling query(object) on navigator.permissions with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL WorkerNavigator interface: attribute permissions assert_true: The prototype object must have a property "permissions" expected true got false
+FAIL WorkerNavigator interface: navigator must inherit property "permissions" with the proper type assert_inherits: property "permissions" not found in prototype chain
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.worker.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,3 @@
+
+FAIL Test Web NFC Permission. undefined is not an object (evaluating 'navigator.permissions.query')
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test Web NFC Permission.</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+  promise_test(function(test) {
+    return navigator.permissions.query({name:'nfc'}).then(function(result) {
+      assert_true(result instanceof PermissionStatus);
+    });
+  });
+</script>
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,6 @@
+
+FAIL Permissions.state is "prompt" with allow="geolocation" in same-origin iframes. assert_equals: navigator.permissions.query("geolocation") expected (string) "prompt" but got (object) null
+FAIL Permissions.state is "prompt" with allow="geolocation" in cross-origin iframes. assert_equals: navigator.permissions.query("geolocation") expected (string) "prompt" but got (object) null
+FAIL Permission.state is "prompt" in same-origin iframes. assert_equals: navigator.permissions.query("geolocation") expected (string) "prompt" but got (object) null
+FAIL Permission.state is "denied" in cross-origin iframes. assert_equals: navigator.permissions.query("geolocation") expected (string) "denied" but got (object) null
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,75 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test permissions query againts feature policy allow attribute</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+  "use strict";
+
+  function test_permissions_query(
+    feature_description, test, src, expect_state, allow_attribute) {
+    let frame = document.createElement('iframe');
+    frame.src = ""
+
+    if (typeof allow_attribute !== 'undefined') {
+      frame.allow = allow_attribute;
+    }
+
+    window.addEventListener('message', test.step_func(function handler(evt) {
+      if (evt.source === frame.contentWindow) {
+        assert_equals(evt.data.state, expect_state, feature_description);
+        document.body.removeChild(frame);
+        window.removeEventListener('message', handler);
+        test.done();
+      }
+    }));
+
+    document.body.appendChild(frame);
+  }
+
+  const same_origin_src =
+    "/permissions/feature-policy-permissions-query.html";
+  const cross_origin_src =
+    "https://{{hosts[alt][]}}:{{ports[https][0]}}" + same_origin_src;
+
+   async_test(t => {
+    test_permissions_query(
+      'navigator.permissions.query("geolocation")',
+      t,
+      same_origin_src,
+      "prompt",
+      "geolocation"
+    );
+  }, 'Permissions.state is "prompt" with allow="geolocation" in same-origin iframes.');
+
+  async_test(t => {
+    test_permissions_query(
+      'navigator.permissions.query("geolocation")',
+      t,
+      cross_origin_src,
+      "prompt",
+      "geolocation"
+    );
+  }, 'Permissions.state is "prompt" with allow="geolocation" in cross-origin iframes.');
+
+   async_test(t => {
+    test_permissions_query(
+      'navigator.permissions.query("geolocation")',
+      t,
+      same_origin_src,
+      "prompt"
+    );
+  }, 'Permission.state is "prompt" in same-origin iframes.');
+
+  async_test(t => {
+    test_permissions_query(
+      'navigator.permissions.query("geolocation")',
+      t,
+      cross_origin_src,
+      "denied"
+    );
+  }, 'Permission.state is "denied" in cross-origin iframes.');
+
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,3 @@
+
+FAIL Test PermissionStatus's name attribute. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.permissions.query')"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test PermissionStatus's name attribute.</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+promise_test(async () => {
+  const result = await navigator.permissions.query({
+    name: "geolocation",
+  });
+  assert_equals(result.name, "geolocation", "Name was geolocation");
+});
+</script>
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,3 @@
+
+FAIL Test "screen-wake-lock" Permission. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.permissions.query')"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test "screen-wake-lock" Permission.</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+promise_test(async () => {
+  const result = await navigator.permissions.query({
+    name: "screen-wake-lock",
+  });
+  assert_true(result instanceof PermissionStatus);
+});
+</script>
\ No newline at end of file

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,3 @@
+
+FAIL Test Background Fetch Permission. undefined is not an object (evaluating 'navigator.permissions.query')
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test Background Fetch Permission.</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+  promise_test(function(test) {
+    return navigator.permissions.query({name:'background-fetch'}).then(function(result) {
+      assert_true(result instanceof PermissionStatus);
+    });
+  });
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission-expected.txt (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission-expected.txt	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,3 @@
+
+FAIL Test Periodic Background Sync Permission. promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.permissions.query')"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission.html (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission.html	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,13 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test Periodic Background Sync Permission.</title>
+<script src=""
+<script src=""
+<div id="log"></div>
+
+<script>
+  promise_test(async test => {
+    const result = await navigator.permissions.query({name:'periodic-background-sync'});
+    assert_true(result instanceof PermissionStatus);
+  });
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/w3c-import.log (0 => 281447)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/w3c-import.log	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/permissions/w3c-import.log	2021-08-23 16:01:29 UTC (rev 281447)
@@ -0,0 +1,25 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+	https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/permissions/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/permissions/feature-policy-permissions-query.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/idlharness.any.js
+/LayoutTests/imported/w3c/web-platform-tests/permissions/nfc-permission.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/permissions-query-feature-policy-attribute.https.sub.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/permissionsstatus-name.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/screen-wake-lock-permission.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/test-background-fetch-permission.html
+/LayoutTests/imported/w3c/web-platform-tests/permissions/test-periodic-background-sync-permission.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to