summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/stub-3.1.3-service-worker-state.html
blob: 8e729baf89f5e786e715ecadd071b06b00a43eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<title>Service Workers: state</title>
    <head>
        <link rel="help" href="https://w3c.github.io/ServiceWorker/#service-worker-state">
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>

    </head>
    <body>

<!--

The [ServiceWorker][1] object can be in several states. The `state` attribute
must return the current state, which must be one of the following values
defined in the [ServiceWorkerState][2] enumeration:

`"installing"`:
    The Service Worker represented by the [ServiceWorker][1] object has entered
    and is running the steps in the [installation process][3]. During this
    state, `e.waitUntil(p)` can be called inside the `oninstall` event handler
    of the associcated [ServiceWorkerGloberScope][4] object to extend the life
    of the [installing worker][5] until the passed [Promise][6] resolves
    successfully. This is primarily used to ensure that the Service Worker is
    not active until all of the core caches are populated.
`"installed"`:
    The Service Worker represented by the [ServiceWorker][1] object has
    completed the steps in the [installation process][3]. The Service Worker in
    this state is considered the [worker in waiting][7].
`"activating"`:
    The Service Worker represented by the [ServiceWorker][1] object has entered
    and is running the steps in the [activation process][8]. During this state,
    `e.waitUntil(p)` can be called inside the `onactivate` event handler of the
    associated [ServiceWorkerGloberScope][9] object to extend the life of the
    activating [active worker][10] until the passed [Promise][6] resolves
    successfully. Note that no [functional events][11] are dispatched until the
    state becomes `"activated"`.
`"activated"`:
    The Service Worker represented by the [ServiceWorker][1] object has
    completed the steps in the [activation process][8]. The Service Worker in
    this state is considered the [active worker][10] ready to [control][12] the
    documents in matching scope upon subsequence [navigation][13].
`"redundant"`:
    A newly created Service Worker [registration][14] is replacing the current
    [registration][14] of the Service Worker.



[1]: #service-worker-interface
[2]: #service-worker-state-enum
[3]: #installation-process
[4]: #service-worker-glober-scope-interface
[5]: #installing-worker
[6]: http://goo.gl/3TobQS
[7]: #worker-in-waiting
[8]: #activation-process
[9]: #service-worker-global-scope-interface
[10]: #active-worker
[11]: #functional-events
[12]: #document-control
[13]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate
[14]: #registration

-->



    <script>
        test(function() {
            // not_implemented();
        }, "There are no tests for section state so far.");
    </script>

    </body>
</html>