diff options
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html')
-rw-r--r-- | testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html b/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html index 00b9070bf1..ab05a3d252 100644 --- a/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html +++ b/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html @@ -27,10 +27,12 @@ const ROUTER_RULE_KEY_URL_PATTERN_CONSTRUCTED_MATCH_ALL_CACHE = const ROUTER_RULE_KEY_URLPATTERN_CACHE_WITH_NAME = 'condition-urlpattern-string-source-cache-with-name'; const ROUTER_RULE_KEY_OR = 'condition-or-source-network' +const ROUTER_RULE_KEY_NOT = 'condition-urlpattern-not-source-network'; const SCOPE = 'resources/'; const HTML_FILE = 'resources/simple.html'; const TXT_FILE = 'resources/direct.txt'; const CSV_FILE = 'resources/simple.csv'; +const NOT_FILE = 'resources/not.txt'; // Warning: please prepare the corresponding `*.text.headers` files, otherwise // iframeTest() fails to load the following files due to MIME mismatches. const OR_TEST_FILES = [ @@ -184,5 +186,17 @@ iframeTest(HTML_FILE, ROUTER_RULE_KEY_URLPATTERN_CACHE_WITH_NAME, async (t, iwin assert_equals(response_with_param.status, 404); }, 'Subresource load matched with the cache source, with specifying the cache name'); +iframeTest(TXT_FILE, ROUTER_RULE_KEY_NOT, async (t, iwin) => { + const rnd = randomString(); + const response = await iwin.fetch(`${NOT_FILE}?nonce=${rnd}`); + assert_equals(await response.text(), rnd); +}, 'Subresource load should not match with the not condition'); + +iframeTest(TXT_FILE, ROUTER_RULE_KEY_NOT, async (t, iwin) => { + const rnd = randomString(); + const response = await iwin.fetch('?nonce=' + rnd); + assert_equals(await response.text(), "Network\n"); +}, 'Subresource load should match with a file other than not'); + </script> </body> |