https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 5e8eef740f9a79e5626fa41ef67a4b6284a6490b authored by Kouhei Ueno on 06 October 2017, 06:35:33 UTC
set{Timeout,Interval} pass along url, nonce, and parser state as specified.
Tip revision: 5e8eef7
clients-matchall-on-evaluation.https.html
<!DOCTYPE html>
<title>Service Worker: Clients.matchAll on script evaluation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/test-helpers.sub.js"></script>
<script>
promise_test(function(t) {
    var script = 'resources/clients-matchall-on-evaluation-worker.js';
    var scope = 'resources/blank.html?clients-matchAll-on-evaluation';

    var saw_message = new Promise(function(resolve) {
        navigator.serviceWorker.onmessage = function(e) {
            assert_equals(e.data, 'matched');
            resolve();
          };
      });

    return service_worker_unregister_and_register(t, script, scope)
      .then(function(registration) {
          add_completion_callback(function() { registration.unregister(); });
          return saw_message;
        });
  }, 'Test Clients.matchAll() on script evaluation');
</script>
back to top