Bug 1884032 [wpt PR 44942] - [css-color] add missing colorscheme-aware tests, a=testonly
[gecko.git] / dom / serviceworkers / test / test_navigator.html
blobaaac04e92603bcf12c74173d4ddfd58068395014
1 <!--
2 Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/
4 -->
5 <!DOCTYPE HTML>
6 <html>
7 <head>
8 <title>Bug 930348 - test stub Navigator ServiceWorker utilities.</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 </head>
12 <body>
13 <p id="display"></p>
14 <div id="content" style="display: none"></div>
15 <pre id="test"></pre>
16 <script class="testbody" type="text/javascript">
18 function checkEnabled() {
19 ok(navigator.serviceWorker, "navigator.serviceWorker should exist when ServiceWorkers are enabled.");
20 ok(typeof navigator.serviceWorker.register === "function", "navigator.serviceWorker.register() should be a function.");
21 ok(typeof navigator.serviceWorker.getRegistration === "function", "navigator.serviceWorker.getAll() should be a function.");
22 ok(typeof navigator.serviceWorker.getRegistrations === "function", "navigator.serviceWorker.getAll() should be a function.");
23 ok(navigator.serviceWorker.ready instanceof Promise, "navigator.serviceWorker.ready should be a Promise.");
24 ok(navigator.serviceWorker.controller === null, "There should be no controller worker for an uncontrolled document.");
27 SimpleTest.waitForExplicitFinish();
29 SpecialPowers.pushPrefEnv({"set": [
30 ["dom.serviceWorkers.exemptFromPerDomainMax", true],
31 ["dom.serviceWorkers.enabled", true],
32 ["dom.serviceWorkers.testing.enabled", true]
33 ]}, function() {
34 checkEnabled();
35 SimpleTest.finish();
36 });
37 </script>
38 </pre>
39 </body>
40 </html>