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: Convert .html tests to .any.js where applicable Most tests can run in window and worker contexts, so make it so. Bug: 161072 Change-Id: Ic0df3a888e477d27562dce957807dde36dc8f420 Reviewed-on: https://chromium-review.googlesource.com/1171255 Commit-Queue: Victor Costan <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#582778} -- wpt-commits: c792ea26624bde49b72afce348de07ab72fb9ad7 wpt-pr: 12449
18 lines
545 B
JavaScript
18 lines
545 B
JavaScript
// META: title=Web Locks API: Lock Attributes
|
|
|
|
'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)');
|