OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <title>Service Workers: fetch(request)</title> |
| 4 <head> |
| 5 <link rel="help" href="https://w3c.github.io/ServiceWorker/#service-work
er-global-scope-fetch"> |
| 6 <script src="/resources/testharness.js"></script> |
| 7 <script src="/resources/testharnessreport.js"></script> |
| 8 |
| 9 </head> |
| 10 <body> |
| 11 |
| 12 <!-- |
| 13 |
| 14 `self.fetch(request)` method must run these steps: |
| 15 |
| 16 1. Let `request` be a [request][1] represented by `request`. |
| 17 2. Set [`client`][2] of `request` to the [JavaScript global |
| 18 environment][3] represented by `self` object. |
| 19 3. Let `promise` be a newly-created [promise][4]. |
| 20 4. Return `promise.` |
| 21 5. Run the following steps asynchronously: |
| 22 1. Let `response` be the result of running [fetch algorithm][5] with |
| 23 `request` as its argument. |
| 24 2. If `response` is a [network error][6], then: |
| 25 1. Reject `promise` with a new [DOMException][7] whose name is |
| 26 "[NetworkError][8]". |
| 27 3. Else, |
| 28 1. Resolve `promise` with a new [Response][9] object associated |
| 29 with `response`. |
| 30 |
| 31 |
| 32 |
| 33 [1]: http://goo.gl/ucOuXl |
| 34 [2]: http://goo.gl/Oxj4xQ |
| 35 [3]: http://goo.gl/ifwwCC |
| 36 [4]: http://goo.gl/3TobQS |
| 37 [5]: http://goo.gl/fGMifs |
| 38 [6]: http://goo.gl/jprjjc |
| 39 [7]: http://goo.gl/A0U8qC |
| 40 [8]: http://goo.gl/lud5HB |
| 41 [9]: http://goo.gl/Deazjv |
| 42 |
| 43 --> |
| 44 |
| 45 |
| 46 |
| 47 <script> |
| 48 test(function() { |
| 49 // not_implemented(); |
| 50 }, "There are no tests for section fetch(request) so far."); |
| 51 </script> |
| 52 |
| 53 </body> |
| 54 </html> |
| 55 |
OLD | NEW |