mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-28 04:39:07 -10:00
Automatic update from web-platform-testsWeb Locks API: Run tests in additional globals Use the "META: global=" annotation to run the web-locks/ tests in shared and service workers, as appropriate. Change-Id: I1d6acd9b4e2932bf3a60b1e41285cbe74e3cb8ff Reviewed-on: https://chromium-review.googlesource.com/1208447 Commit-Queue: Victor Costan <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#590265} -- wpt-commits: 7d538d126b49411702cdd88354f520cdf9a65702 wpt-pr: 12860
19 lines
611 B
JavaScript
19 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)');
|