summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/interfaces/service-workers.idl
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/interfaces/service-workers.idl')
-rw-r--r--testing/web-platform/tests/interfaces/service-workers.idl36
1 files changed, 35 insertions, 1 deletions
diff --git a/testing/web-platform/tests/interfaces/service-workers.idl b/testing/web-platform/tests/interfaces/service-workers.idl
index 6d44d61deb..c740e1098a 100644
--- a/testing/web-platform/tests/interfaces/service-workers.idl
+++ b/testing/web-platform/tests/interfaces/service-workers.idl
@@ -92,7 +92,7 @@ dictionary NavigationPreloadState {
ByteString headerValue;
};
-[Global=(Worker,ServiceWorker), Exposed=ServiceWorker]
+[Global=(Worker,ServiceWorker), Exposed=ServiceWorker, SecureContext]
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
[SameObject] readonly attribute Clients clients;
[SameObject] readonly attribute ServiceWorkerRegistration registration;
@@ -166,6 +166,40 @@ dictionary ExtendableEventInit : EventInit {
};
[Exposed=ServiceWorker]
+interface InstallEvent : ExtendableEvent {
+ Promise<undefined> addRoutes((RouterRule or sequence<RouterRule>) rules);
+};
+
+dictionary RouterRule {
+ required RouterCondition condition;
+ required RouterSource source;
+};
+
+dictionary RouterCondition {
+ URLPatternCompatible urlPattern;
+ ByteString requestMethod;
+ RequestMode requestMode;
+ RequestDestination requestDestination;
+ RunningStatus runningStatus;
+
+ sequence<RouterCondition> _or;
+};
+
+typedef (RouterSourceDict or RouterSourceEnum) RouterSource;
+
+dictionary RouterSourceDict {
+ DOMString cacheName;
+};
+
+enum RunningStatus { "running", "not-running" };
+enum RouterSourceEnum {
+ "cache",
+ "fetch-event",
+ "network",
+ "race-network-and-fetch-handler"
+};
+
+[Exposed=ServiceWorker]
interface FetchEvent : ExtendableEvent {
constructor(DOMString type, FetchEventInit eventInitDict);
[SameObject] readonly attribute Request request;