diff options
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html')
-rw-r--r-- | testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html b/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html index 9ef7cfdc9f..15b8ef5742 100644 --- a/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html +++ b/testing/web-platform/tests/service-workers/service-worker/tentative/static-router/static-router-invalid-rules.https.html @@ -17,8 +17,14 @@ const ROUTER_RULE_KEY_INVALID_REQUEST_METHOD = 'condition-invalid-request-method'; const ROUTER_RULE_KEY_INVALID_OR_CONDITION_DEPTH = 'condition-invalid-or-condition-depth'; +const ROUTER_RULE_KEY_INVALID_NOT_CONDITION_DEPTH = + 'condition-invalid-not-condition-depth'; const ROUTER_RULE_KEY_INVALID_ROUTER_SIZE = 'condition-invalid-router-size'; +const ROUTER_RULE_KEY_LACK_OF_CONDITION = + 'condition-lack-of-condition'; +const ROUTER_RULE_KEY_LACK_OF_SOURCE = + 'condition-lack-of-source'; promise_test(async t => { const worker = await registerAndActivate(t, ROUTER_RULE_KEY_INVALID_REQUEST_METHOD); @@ -35,11 +41,33 @@ promise_test(async t => { }, 'addRoutes should raise if or condition exceeds the depth limit'); promise_test(async t => { + const worker = await registerAndActivate(t, ROUTER_RULE_KEY_INVALID_NOT_CONDITION_DEPTH); + t.add_cleanup(() => {reset_info_in_worker(worker)}); + const {errors} = await get_info_from_worker(worker); + assert_equals(errors.length, 1); +}, 'addRoutes should raise if not condition exceeds the depth limit'); + +promise_test(async t => { const worker = await registerAndActivate(t, ROUTER_RULE_KEY_INVALID_ROUTER_SIZE); t.add_cleanup(() => {reset_info_in_worker(worker)}); const {errors} = await get_info_from_worker(worker); assert_equals(errors.length, 1); }, 'addRoutes should raise if the number of router rules exceeds the length limit'); +promise_test(async t => { + const worker = await registerAndActivate(t, ROUTER_RULE_KEY_LACK_OF_CONDITION); + t.add_cleanup(() => {reset_info_in_worker(worker)}); + const {errors} = await get_info_from_worker(worker); + assert_equals(errors.length, 1); +}, 'addRoutes should raise if the conditon does not exist in the rule'); + +promise_test(async t => { + const worker = await registerAndActivate(t, ROUTER_RULE_KEY_LACK_OF_SOURCE); + t.add_cleanup(() => {reset_info_in_worker(worker)}); + const {errors} = await get_info_from_worker(worker); + assert_equals(errors.length, 1); +}, 'addRoutes should raise if the source does not exiswt in the rule'); + + </script> </body> |