Title: [285954] trunk
Revision
285954
Author
[email protected]
Date
2021-11-17 14:28:11 -0800 (Wed, 17 Nov 2021)

Log Message

Web Locks API does get enabled in Service Workers when running layout tests
https://bugs.webkit.org/show_bug.cgi?id=233273

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing in service workers.

* web-platform-tests/web-locks/acquire.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/clientids.tentative.https-expected.txt:
* web-platform-tests/web-locks/held.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/idlharness.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/ifAvailable.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/lock-attributes.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/mode-exclusive.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/mode-mixed.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/mode-shared.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/query-empty.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/resource-names.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/secure-context.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/signal.tentative.https.any.serviceworker-expected.txt:
* web-platform-tests/web-locks/steal.tentative.https.any.serviceworker-expected.txt:

Source/WebCore:

Use RuntimeEnabledFeatures to back the Web Lock API since regular settings do not get
properly propagated to service workers at the moment.

No new tests, rebaselined existing ones.

* Modules/web-locks/NavigatorLocks.idl:
* Modules/web-locks/WebLock.idl:
* Modules/web-locks/WebLockManager.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebLocksAPIEnabled):
(WebCore::RuntimeEnabledFeatures::webLocksAPIEnabled const):

Source/WTF:

Use RuntimeEnabledFeatures to back the Web Lock API since regular settings do not get
properly propagated to service workers at the moment.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,3 +1,27 @@
+2021-11-17  Chris Dumez  <[email protected]>
+
+        Web Locks API does get enabled in Service Workers when running layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=233273
+
+        Reviewed by Geoffrey Garen.
+
+        Rebaseline WPT tests now that more checks are passing in service workers.
+
+        * web-platform-tests/web-locks/acquire.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/clientids.tentative.https-expected.txt:
+        * web-platform-tests/web-locks/held.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/idlharness.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/ifAvailable.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/lock-attributes.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/mode-exclusive.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/mode-mixed.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/mode-shared.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/query-empty.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/resource-names.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/secure-context.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/signal.tentative.https.any.serviceworker-expected.txt:
+        * web-platform-tests/web-locks/steal.tentative.https.any.serviceworker-expected.txt:
+
 2021-11-17  Antti Koivisto  <[email protected]>
 
         Update web-platform-tests/css/selectors

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/acquire.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/acquire.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/acquire.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,12 +1,14 @@
 
-FAIL navigator.locks.request requires a name and a callback promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL mode must be "shared" or "exclusive" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL The 'steal' and 'ifAvailable' options are mutually exclusive promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL The 'steal' option must be used with exclusive locks promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL The 'signal' and 'steal' options are mutually exclusive promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL The 'signal' and 'ifAvailable' options are mutually exclusive promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL callback must be a function promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL navigator.locks.request's returned promise resolves after lock is released promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Returned Promise rejects if callback throws synchronously promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Returned Promise rejects if callback throws asynchronously promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+Harness Error (FAIL), message = Unhandled rejection: The operation is not supported.
 
+PASS navigator.locks.request requires a name and a callback
+FAIL mode must be "shared" or "exclusive" promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+PASS The 'steal' and 'ifAvailable' options are mutually exclusive
+PASS The 'steal' option must be used with exclusive locks
+PASS The 'signal' and 'steal' options are mutually exclusive
+PASS The 'signal' and 'ifAvailable' options are mutually exclusive
+PASS callback must be a function
+FAIL navigator.locks.request's returned promise resolves after lock is released promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Returned Promise rejects if callback throws synchronously promise_rejects_exactly: result should reject function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." but we expected it to throw object "[object Object]"
+FAIL Returned Promise rejects if callback throws asynchronously promise_rejects_exactly: result should reject function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." but we expected it to throw object "[object Object]"
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/clientids.tentative.https-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/clientids.tentative.https-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/clientids.tentative.https-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,4 +1,4 @@
 
 
-FAIL Client IDs match between Locks API and Service Workers assert_equals: clientIds should match, but are different expected "14-85" but got "NotSupportedError: The operation is not supported."
+FAIL Client IDs match between Locks API and Service Workers assert_equals: clientIds should match, but are different expected "15-85" but got "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/held.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/held.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/held.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,6 +1,8 @@
 
-FAIL callback's result is promisified if not async promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL lock is held until callback's returned promise resolves promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL lock is held until callback's returned promise rejects promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL held lock prevents the same client from acquiring it promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+Harness Error (TIMEOUT), message = null
 
+FAIL callback's result is promisified if not async promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+TIMEOUT lock is held until callback's returned promise resolves Test timed out
+NOTRUN lock is held until callback's returned promise rejects
+NOTRUN held lock prevents the same client from acquiring it
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/idlharness.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/idlharness.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/idlharness.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -15,34 +15,34 @@
 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 LockManager interface: existence and properties of interface object assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface object length assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface object name assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: existence and properties of interface prototype object assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: operation request(DOMString, LockGrantedCallback) assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: operation request(DOMString, LockOptions, LockGrantedCallback) assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager interface: operation query() assert_own_property: self does not have own property "LockManager" expected property "LockManager" missing
-FAIL LockManager must be primary interface of navigator.locks assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL Stringification of navigator.locks assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL LockManager interface: navigator.locks must inherit property "request(DOMString, LockGrantedCallback)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL LockManager interface: calling request(DOMString, LockGrantedCallback) on navigator.locks with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL LockManager interface: navigator.locks must inherit property "request(DOMString, LockOptions, LockGrantedCallback)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL LockManager interface: calling request(DOMString, LockOptions, LockGrantedCallback) on navigator.locks with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL LockManager interface: navigator.locks must inherit property "query()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL Lock interface: existence and properties of interface object assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface object length assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface object name assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface: attribute name assert_own_property: self does not have own property "Lock" expected property "Lock" missing
-FAIL Lock interface: attribute mode assert_own_property: self does not have own property "Lock" expected property "Lock" missing
+PASS LockManager interface: existence and properties of interface object
+PASS LockManager interface object length
+PASS LockManager interface object name
+PASS LockManager interface: existence and properties of interface prototype object
+PASS LockManager interface: existence and properties of interface prototype object's "constructor" property
+PASS LockManager interface: existence and properties of interface prototype object's @@unscopables property
+PASS LockManager interface: operation request(DOMString, LockGrantedCallback)
+PASS LockManager interface: operation request(DOMString, LockOptions, LockGrantedCallback)
+PASS LockManager interface: operation query()
+PASS LockManager must be primary interface of navigator.locks
+PASS Stringification of navigator.locks
+PASS LockManager interface: navigator.locks must inherit property "request(DOMString, LockGrantedCallback)" with the proper type
+PASS LockManager interface: calling request(DOMString, LockGrantedCallback) on navigator.locks with too few arguments must throw TypeError
+PASS LockManager interface: navigator.locks must inherit property "request(DOMString, LockOptions, LockGrantedCallback)" with the proper type
+PASS LockManager interface: calling request(DOMString, LockOptions, LockGrantedCallback) on navigator.locks with too few arguments must throw TypeError
+PASS LockManager interface: navigator.locks must inherit property "query()" with the proper type
+PASS Lock interface: existence and properties of interface object
+PASS Lock interface object length
+PASS Lock interface object name
+PASS Lock interface: existence and properties of interface prototype object
+PASS Lock interface: existence and properties of interface prototype object's "constructor" property
+PASS Lock interface: existence and properties of interface prototype object's @@unscopables property
+PASS Lock interface: attribute name
+PASS Lock interface: attribute mode
 FAIL Lock must be primary interface of lock assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: lock"
 FAIL Stringification of lock assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: lock"
 FAIL Lock interface: lock must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: lock"
 FAIL Lock interface: lock must inherit property "mode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: lock"
-FAIL WorkerNavigator interface: attribute locks assert_true: The prototype object must have a property "locks" expected true got false
-FAIL WorkerNavigator interface: navigator must inherit property "locks" with the proper type assert_inherits: property "locks" not found in prototype chain
+PASS WorkerNavigator interface: attribute locks
+PASS WorkerNavigator interface: navigator must inherit property "locks" with the proper type
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/ifAvailable.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/ifAvailable.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/ifAvailable.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,12 +1,12 @@
 
-FAIL Lock request with ifAvailable - lock available promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Lock request with ifAvailable - lock not available promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Lock request with ifAvailable - lock not available, callback throws promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Lock request with ifAvailable - unrelated lock held promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Shared lock request with ifAvailable - shared lock held promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Exclusive lock request with ifAvailable - shared lock held promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Shared lock request with ifAvailable - exclusive lock held promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Returned Promise rejects if callback throws synchronously promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Returned Promise rejects if async callback yields rejected promise promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Locks are available once previous release is processed promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+FAIL Lock request with ifAvailable - lock available promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Lock request with ifAvailable - lock not available promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Lock request with ifAvailable - lock not available, callback throws promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Lock request with ifAvailable - unrelated lock held promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Shared lock request with ifAvailable - shared lock held promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Exclusive lock request with ifAvailable - shared lock held promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Shared lock request with ifAvailable - exclusive lock held promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Returned Promise rejects if callback throws synchronously promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Returned Promise rejects if async callback yields rejected promise promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Locks are available once previous release is processed promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/lock-attributes.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/lock-attributes.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/lock-attributes.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,4 +1,4 @@
 
-FAIL Lock attributes reflect requested properties (exclusive) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Lock attributes reflect requested properties (shared) promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+FAIL Lock attributes reflect requested properties (exclusive) promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Lock attributes reflect requested properties (shared) promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-exclusive.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-exclusive.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-exclusive.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,4 +1,4 @@
 
-FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Requests for distinct resources can be granted promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Requests for distinct resources can be granted promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-mixed.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-mixed.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-mixed.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,5 +1,7 @@
 
-FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Releasing exclusive lock grants multiple shared locks promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL An exclusive lock between shared locks promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+Harness Error (FAIL), message = Unhandled rejection: The operation is not supported.
 
+FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Releasing exclusive lock grants multiple shared locks promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL An exclusive lock between shared locks promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-shared.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-shared.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/mode-shared.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,4 +1,4 @@
 
-FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Shared locks are not exclusive promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+FAIL Lock requests are granted in order promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Shared locks are not exclusive promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/query-empty.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/query-empty.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/query-empty.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,3 +1,3 @@
 
-FAIL query() returns dictionary with empty arrays when no locks are held promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.query')"
+FAIL query() returns dictionary with empty arrays when no locks are held promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/resource-names.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/resource-names.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/resource-names.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,10 +1,10 @@
 
-FAIL DOMString:  promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL DOMString: 0x61 0x62 0x63 0x0 0x64 0x65 0x66 promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL DOMString: 0xD800 promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL DOMString: 0xDC00 promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL DOMString: 0xDC00 0xD800 promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL DOMString: 0xFFFF promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Resource names that are not valid UTF-16 are not mangled promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Names cannot start with "-" promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+FAIL DOMString:  promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL DOMString: 0x61 0x62 0x63 0x0 0x64 0x65 0x66 promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL DOMString: 0xD800 promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL DOMString: 0xDC00 promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL DOMString: 0xDC00 0xD800 promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL DOMString: 0xFFFF promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Resource names that are not valid UTF-16 are not mangled promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Names cannot start with "-" promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/secure-context.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/secure-context.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/secure-context.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,3 +1,3 @@
 
-FAIL API presence in secure contexts assert_idl_attribute: navigator.locks exists in secure context property "locks" not found in prototype chain
+PASS API presence in secure contexts
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/signal.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/signal.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/signal.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,11 +1,13 @@
 
-FAIL The signal option must be an AbortSignal promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Passing an already aborted signal aborts promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL An aborted request results in AbortError promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Abort after a timeout promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Signal that is not aborted promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Synchronously signaled abort promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Abort signaled after lock granted promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Abort signaled after lock released promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Abort should process the next pending lock request promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+Harness Error (TIMEOUT), message = null
 
+PASS The signal option must be an AbortSignal
+FAIL Passing an already aborted signal aborts promise_rejects_dom: Request should reject with AbortError function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
+FAIL An aborted request results in AbortError promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Abort after a timeout promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Signal that is not aborted promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Synchronously signaled abort promise_rejects_dom: Request should abort function "function () { throw e }" threw object "NotSupportedError: The operation is not supported." that is not a DOMException AbortError: property "code" is equal to 9, expected 20
+TIMEOUT Abort signaled after lock granted Test timed out
+NOTRUN Abort signaled after lock released
+NOTRUN Abort should process the next pending lock request
+

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/steal.tentative.https.any.serviceworker-expected.txt (285953 => 285954)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/steal.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-locks/steal.tentative.https.any.serviceworker-expected.txt	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,7 +1,9 @@
 
-FAIL Lock available promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Lock not available promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Broken lock's release promise rejects promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Requested lock's release promise is deferred promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
-FAIL Last caller wins promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.locks.request')"
+Harness Error (FAIL), message = Unhandled rejection: The operation is not supported.
 
+FAIL Lock available promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Lock not available promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Broken lock's release promise rejects promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Requested lock's release promise is deferred promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL Last caller wins promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+

Modified: trunk/Source/WTF/ChangeLog (285953 => 285954)


--- trunk/Source/WTF/ChangeLog	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WTF/ChangeLog	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,3 +1,15 @@
+2021-11-17  Chris Dumez  <[email protected]>
+
+        Web Locks API does get enabled in Service Workers when running layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=233273
+
+        Reviewed by Geoffrey Garen.
+
+        Use RuntimeEnabledFeatures to back the Web Lock API since regular settings do not get
+        properly propagated to service workers at the moment.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+
 2021-11-17  Dean Jackson  <[email protected]>
 
         Add ModelDocument for directly showing content that can be handled by <model>

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (285953 => 285954)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1539,6 +1539,7 @@
   type: bool
   humanReadableName: "Web Locks API"
   humanReadableDescription: "Web Locks API"
+  webcoreBinding: RuntimeEnabledFeatures
   defaultValue:
     WebKitLegacy:
       default: false

Modified: trunk/Source/WebCore/ChangeLog (285953 => 285954)


--- trunk/Source/WebCore/ChangeLog	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WebCore/ChangeLog	2021-11-17 22:28:11 UTC (rev 285954)
@@ -1,3 +1,22 @@
+2021-11-17  Chris Dumez  <[email protected]>
+
+        Web Locks API does get enabled in Service Workers when running layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=233273
+
+        Reviewed by Geoffrey Garen.
+
+        Use RuntimeEnabledFeatures to back the Web Lock API since regular settings do not get
+        properly propagated to service workers at the moment.
+
+        No new tests, rebaselined existing ones.
+
+        * Modules/web-locks/NavigatorLocks.idl:
+        * Modules/web-locks/WebLock.idl:
+        * Modules/web-locks/WebLockManager.idl:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebLocksAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::webLocksAPIEnabled const):
+
 2021-11-17  Tim Horton  <[email protected]>
 
         Momentum animator sometimes starts the animation at a very high velocity

Modified: trunk/Source/WebCore/Modules/web-locks/NavigatorLocks.idl (285953 => 285954)


--- trunk/Source/WebCore/Modules/web-locks/NavigatorLocks.idl	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WebCore/Modules/web-locks/NavigatorLocks.idl	2021-11-17 22:28:11 UTC (rev 285954)
@@ -23,7 +23,7 @@
  */
 
 [
-    EnabledBySetting=WebLocksAPIEnabled,
+    EnabledAtRuntime=WebLocksAPIEnabled,
     SecureContext
 ] interface mixin NavigatorLocks {
     readonly attribute WebLockManager locks;

Modified: trunk/Source/WebCore/Modules/web-locks/WebLock.idl (285953 => 285954)


--- trunk/Source/WebCore/Modules/web-locks/WebLock.idl	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WebCore/Modules/web-locks/WebLock.idl	2021-11-17 22:28:11 UTC (rev 285954)
@@ -23,7 +23,7 @@
  */
 
 [
-    EnabledBySetting=WebLocksAPIEnabled,
+    EnabledAtRuntime=WebLocksAPIEnabled,
     Exposed=(Window,Worker),
     ImplementationLacksVTable,
     InterfaceName=Lock,

Modified: trunk/Source/WebCore/Modules/web-locks/WebLockManager.idl (285953 => 285954)


--- trunk/Source/WebCore/Modules/web-locks/WebLockManager.idl	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WebCore/Modules/web-locks/WebLockManager.idl	2021-11-17 22:28:11 UTC (rev 285954)
@@ -23,7 +23,7 @@
  */
 
 [
-    EnabledBySetting=WebLocksAPIEnabled,
+    EnabledAtRuntime=WebLocksAPIEnabled,
     Exposed=(Window,Worker),
     InterfaceName=LockManager,
     ImplementationLacksVTable,

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (285953 => 285954)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2021-11-17 22:21:59 UTC (rev 285953)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2021-11-17 22:28:11 UTC (rev 285954)
@@ -263,6 +263,9 @@
     bool modelDocumentEnabled() const { return m_modelDocumentEnabled; }
 #endif
 
+    void setWebLocksAPIEnabled(bool isEnabled) { m_webLocksAPIEnabled = isEnabled; }
+    bool webLocksAPIEnabled() const { return m_webLocksAPIEnabled; }
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures();
@@ -407,6 +410,8 @@
     bool m_modelDocumentEnabled { false };
 #endif
 
+    bool m_webLocksAPIEnabled { false };
+
     friend class NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to