OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <title>Service Workers: InstallPhaseEvent</title> | 3 <title>Service Workers: InstallPhaseEvent</title> |
4 <head> | 4 <head> |
5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#install-phas
e-event"> | 5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#install-phas
e-event"> |
6 <script src="/resources/testharness.js"></script> | 6 <script src="/resources/testharness.js"></script> |
7 <script src="/resources/testharnessreport.js"></script> | 7 <script src="/resources/testharnessreport.js"></script> |
8 | 8 |
9 <script src=/resources/WebIDLParser.js></script> | 9 <script src=/resources/WebIDLParser.js></script> |
10 <script src=/resources/idlharness.js></script> | 10 <script src=/resources/idlharness.js></script> |
11 | 11 |
12 </head> | 12 </head> |
13 <body> | 13 <body> |
14 | 14 |
15 <script type=text/plain id="idl_0"> | 15 <script type=text/plain id="idl_0"> |
16 interface InstallPhaseEvent : Event { | 16 interface InstallPhaseEvent : Event { |
17 Promise<any> waitUntil(Promise<any> f); | 17 Promise<any> waitUntil(Promise<any> f); |
18 }; | 18 }; |
19 </pre> | 19 </script> |
20 | 20 |
21 <!-- | 21 <!-- |
22 Service Workers have two [Lifecycle events][1], `[install][2]` and | 22 Service Workers have two [Lifecycle events][1], `[install][2]` and |
23 `[activate][3]`. Service Workers use the `[InstallPhaseEvent][4]` interface for | 23 `[activate][3]`. Service Workers use the `[InstallPhaseEvent][4]` interface for |
24 `[activate][3]` event and the `[InstallEvent][5]` interface, which inherits | 24 `[activate][3]` event and the `[InstallEvent][5]` interface, which inherits |
25 from the `[InstallPhaseEvent][4]` interface, for `[install][2]` event. | 25 from the `[InstallPhaseEvent][4]` interface, for `[install][2]` event. |
26 | 26 |
27 [1]: #lifecycle-events | 27 [1]: #lifecycle-events |
28 [2]: #install-event | 28 [2]: #install-event |
29 [3]: #activate-event | 29 [3]: #activate-event |
30 [4]: #install-phase-event-interface | 30 [4]: #install-phase-event-interface |
31 [5]: #install-event-interface | 31 [5]: #install-event-interface |
32 --> | 32 --> |
33 | 33 |
34 | 34 |
35 <script type=text/plain id="untested_idls"> | 35 <script type=text/plain id="untested_idls"> |
36 interface Event {}; | 36 interface Event {}; |
37 </pre> | 37 </script> |
38 | 38 |
39 <script> | 39 <script> |
40 var idl_array = new IdlArray(); | 40 var idl_array = new IdlArray(); |
41 idl_array.add_untested_idls(document.getElementById("untested_idls").tex
tContent); | 41 idl_array.add_untested_idls(document.getElementById("untested_idls").tex
tContent); |
42 idl_array.add_idls(document.getElementById("idl_0").textContent); | 42 idl_array.add_idls(document.getElementById("idl_0").textContent); |
43 idl_array.add_objects({ | 43 idl_array.add_objects({ |
44 InstallPhaseEvent: ["throw new Error ('No object defined for the Ins
tallPhaseEvent interface')"] | 44 InstallPhaseEvent: ["throw new Error ('No object defined for the Ins
tallPhaseEvent interface')"] |
45 }); | 45 }); |
46 idl_array.test(); | 46 idl_array.test(); |
47 </script> | 47 </script> |
48 | 48 |
49 </body> | 49 </body> |
50 </html> | 50 </html> |
51 | 51 |
OLD | NEW |