https://github.com/web-platform-tests/wpt
Revision e27c34b3acf89132571e1f8e308b2bbe365c9b98 authored by Henrik Skupin on 16 August 2018, 16:51:07 UTC, committed by jgraham on 17 August 2018, 09:46:38 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1483801
gecko-commit: e1cfd8ee66d4f1696e922dccd3bcfb9d9dac7a36
gecko-integration-branch: mozilla-inbound
gecko-reviewers: ato
1 parent 2dda7b8
Raw File
Tip revision: e27c34b3acf89132571e1f8e308b2bbe365c9b98 authored by Henrik Skupin on 16 August 2018, 16:51:07 UTC
[wdspec] Create tests for Get Window Handle and Get Window Handles.
Tip revision: e27c34b
activation-api-click.tentative.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>
back to top