servo/tests/wpt/web-platform-tests/web-locks/lock-attributes.tentative.https.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>