mirror of
https://github.com/servo/servo.git
synced 2025-07-13 02:13:40 +01:00
34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Tentative due to:
|
|
https://github.com/whatwg/html/issues/1983
|
|
-->
|
|
<html>
|
|
<head>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/testdriver.js"></script>
|
|
<script src="/resources/testdriver-vendor.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Clicking on document sets user activation</h1>
|
|
<p>Click anywhere in the document.</p>
|
|
<script>
|
|
async_test(function(t) {
|
|
assert_false(navigator.userActivation.hasBeenActive);
|
|
assert_false(navigator.userActivation.isActive);
|
|
window.addEventListener("click", t.step_func_done(event => {
|
|
assert_true(navigator.userActivation.hasBeenActive);
|
|
assert_true(navigator.userActivation.isActive);
|
|
|
|
// Opening a window should consume the activation.
|
|
var win = window.open('404.html');
|
|
win.close();
|
|
assert_true(navigator.userActivation.hasBeenActive);
|
|
assert_false(navigator.userActivation.isActive);
|
|
}));
|
|
test_driver.click(document.body);
|
|
}, "Values adjust on activity");
|
|
</script>
|
|
</body>
|
|
</html>
|