mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
24 lines
774 B
HTML
24 lines
774 B
HTML
<!DOCTYPE html>
|
|
<meta charset=utf-8>
|
|
<title>Web Locks API: Lock Attributes</title>
|
|
<link rel=help href="https://github.com/inexorabletash/web-locks">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
'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)');
|
|
|
|
</script>
|