OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8"> |
| 5 <title>Background Fetch IDL tests</title> |
| 6 <script src=/resources/testharness.js></script> |
| 7 <script src=/resources/testharnessreport.js></script> |
| 8 <script src=/resources/WebIDLParser.js></script> |
| 9 <script src=/resources/idlharness.js></script> |
| 10 </head> |
| 11 <body> |
| 12 <!-- Setup --> |
| 13 <script type=text/plain id='untested_idl'> |
| 14 interface ServiceWorkerGlobalScope { |
| 15 }; |
| 16 interface ServiceWorkerRegistration { |
| 17 }; |
| 18 </script> |
| 19 <script type=text/plain id='idl_for_testing'> |
| 20 partial interface ServiceWorkerGlobalScope { |
| 21 attribute EventHandler onbackgroundfetched; |
| 22 attribute EventHandler onbackgroundfetchfail; |
| 23 attribute EventHandler onbackgroundfetchabort; |
| 24 attribute EventHandler onbackgroundfetchclick; |
| 25 }; |
| 26 |
| 27 partial interface ServiceWorkerRegistration { |
| 28 readonly attribute BackgroundFetchManager backgroundFetch; |
| 29 }; |
| 30 |
| 31 [Exposed=(Window,Worker)] |
| 32 interface BackgroundFetchManager { |
| 33 Promise<BackgroundFetchRegistration> fetch(DOMString tag, |
| 34 (RequestInfo or sequence<RequestInfo>) requests, |
| 35 optional BackgroundFetchOptions options); |
| 36 Promise<BackgroundFetchRegistration?> get(DOMString tag); |
| 37 Promise<sequence<DOMString>> getTags(); |
| 38 }; |
| 39 |
| 40 dictionary IconDefinition { |
| 41 DOMString src; |
| 42 DOMString sizes; |
| 43 DOMString type; |
| 44 }; |
| 45 |
| 46 dictionary BackgroundFetchOptions { |
| 47 sequence<IconDefinition> icons; |
| 48 DOMString title; |
| 49 long totalDownloadSize; |
| 50 }; |
| 51 |
| 52 [Exposed=(Window,Worker)] |
| 53 interface BackgroundFetchActiveFetches : BackgroundFetchFetches { |
| 54 readonly attribute Promise<Response> responseReady; |
| 55 }; |
| 56 |
| 57 [Exposed=(Window,Worker)] |
| 58 interface BackgroundFetchRegistration { |
| 59 readonly attribute DOMString tag; |
| 60 readonly attribute FrozenArray<IconDefinition> icons; |
| 61 readonly attribute long totalDownloadSize; |
| 62 readonly attribute DOMString title; |
| 63 readonly attribute FrozenArray<BackgroundFetchActiveFetches> fetches; |
| 64 |
| 65 void abort(); |
| 66 }; |
| 67 |
| 68 [Exposed=(Window,Worker)] |
| 69 interface BackgroundFetchFetches { |
| 70 readonly attribute Request request; |
| 71 }; |
| 72 |
| 73 </script> |
| 74 |
| 75 <!-- Tests --> |
| 76 <script> |
| 77 var idl_array = new IdlArray(); |
| 78 idl_array.add_untested_idls( |
| 79 document.getElementById('untested_idl').textContent); |
| 80 idl_array.add_idls( |
| 81 document.getElementById('idl_for_testing').textContent); |
| 82 idl_array.test(); |
| 83 |
| 84 </script> |
| 85 </body> |
| 86 </html> |
OLD | NEW |