1
0
Fork 0
firefox/testing/web-platform/tests/web-locks/lock-attributes.https.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

18 lines
611 B
JavaScript

// META: title=Web Locks API: Lock Attributes
// META: global=window,dedicatedworker,sharedworker,serviceworker
'use strict';
promise_test(async t => {
await navigator.locks.request('resource', lock => {
assert_equals(lock.name, 'resource');
assert_equals(lock.mode, 'exclusive');
});
}, 'Lock attributes reflect requested properties (exclusive)');
promise_test(async t => {
await navigator.locks.request('resource', {mode: 'shared'}, lock => {
assert_equals(lock.name, 'resource');
assert_equals(lock.mode, 'shared');
});
}, 'Lock attributes reflect requested properties (shared)');