Bug 1539614 [wpt PR 16077] - HTML: move textarea tests together, a=testonly
[gecko.git] / testing / web-platform / tests / service-workers / stub-4.1-service-worker-global-scope.html
blobc11feaca4c832bb90562868a6d78d4ac0ee017fc
1 <!DOCTYPE html>
2 <html>
3 <title>Service Workers: ServiceWorkerGlobalScope</title>
4 <head>
5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#service-worker-global-scope">
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
9 <script src=/resources/WebIDLParser.js></script>
10 <script src=/resources/idlharness.js></script>
12 </head>
13 <body>
15 <script type=text/plain id="idl_0">
16 [Global]
17 interface ServiceWorkerGlobalScope : WorkerGlobalScope {
18 readonly attribute CacheStorage caches;
19 // A container for a list of window objects, identifiable by ID, that
20 // correspond to windows (or workers) that are "controlled" by this SW
21 readonly attribute ServiceWorkerClients clients;
22 [Unforgeable] readonly attribute DOMString scope;
24 Promise<any> fetch((Request or ScalarValueString) request);
26 void update();
27 void unregister();
29 attribute EventHandler oninstall;
30 attribute EventHandler onactivate;
31 attribute EventHandler onfetch;
32 attribute EventHandler onbeforeevicted;
33 attribute EventHandler onevicted;
35 // The event.source of these MessageEvents are instances of Client
36 attribute EventHandler onmessage;
38 // close() method inherited from WorkerGlobalScope is not exposed.
40 </script>
42 <!--
43 The `ServiceWorkerGlobalScope` interface represents the global execution
44 context of a Service Worker. `ServiceWorkerGlobalScope` object provides
45 generic, event-driven, time-limited script execution contexts that run at an
46 origin. Once successfully [registered][1], a Service Worker is started, kept
47 alive and killed by their relationship to events, not documents. Any type of
48 synchronous requests MUST NOT be initiated inside of a Service Worker.
50 [1]: #navigator-service-worker-register
51 -->
54 <script type=text/plain id="untested_idls">
55 interface CacheStorage {};
56 interface ServiceWorkerClients {};
57 interface Request {};
58 interface ScalarValueString {};
59 interface EventHandler {};
60 interface WorkerGlobalScope {};
61 </script>
63 <script>
64 var idl_array = new IdlArray();
65 idl_array.add_untested_idls(document.getElementById("untested_idls").textContent);
66 idl_array.add_idls(document.getElementById("idl_0").textContent);
67 idl_array.add_objects({
68 ServiceWorkerGlobalScope: ["throw new Error ('No object defined for the ServiceWorkerGlobalScope interface')"]
69 });
70 idl_array.test();
71 </script>
73 </body>
74 </html>