Commit b5adb981 authored by Makoto Shimazu's avatar Makoto Shimazu Committed by Commit Bot

Add missing await to wpt/.../service-worker/update.https.html

promise_reject returns a promise and needs await.

Bug: n/a
Change-Id: Ida68b118be05268d9e74c9c22886f9064537e700
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1708663Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Makoto Shimazu <shimazu@chromium.org>
Auto-Submit: Makoto Shimazu <shimazu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679854}
parent eed19c5c
This is a testharness.js-based test. This is a testharness.js-based test.
Harness Error. harness_status.status = 1 , harness_status.message = assert_throws: function "function() { throw e }" threw object "SecurityError: Failed to update a ServiceWorker: The script resource is behind a redirect, which is disallowed." ("SecurityError") expected object "TypeError" ("TypeError")
PASS update() should succeed when new script is available. PASS update() should succeed when new script is available.
PASS update() should fail when mime type is invalid. PASS update() should fail when mime type is invalid.
PASS update() should fail when a response for the main script is redirect. FAIL update() should fail when a response for the main script is redirect. assert_throws: function "function() { throw e }" threw object "SecurityError: Failed to update a ServiceWorker: The script resource is behind a redirect, which is disallowed." ("SecurityError") expected object "TypeError" ("TypeError")
PASS update() should fail when a new script contains a syntax error. PASS update() should fail when a new script contains a syntax error.
PASS update() should resolve when the install event throws. PASS update() should resolve when the install event throws.
PASS update() should fail when the pending uninstall flag is set. PASS update() should fail when the pending uninstall flag is set.
......
...@@ -75,7 +75,7 @@ promise_test(async t => { ...@@ -75,7 +75,7 @@ promise_test(async t => {
await prepare_ready_registration(t, 'bad_mime_type'); await prepare_ready_registration(t, 'bad_mime_type');
t.add_cleanup(() => registration.unregister()); t.add_cleanup(() => registration.unregister());
promise_rejects(t, 'SecurityError', registration.update()); await promise_rejects(t, 'SecurityError', registration.update());
assert_active_only(registration, expected_url); assert_active_only(registration, expected_url);
}, 'update() should fail when mime type is invalid.'); }, 'update() should fail when mime type is invalid.');
...@@ -84,7 +84,7 @@ promise_test(async t => { ...@@ -84,7 +84,7 @@ promise_test(async t => {
await prepare_ready_registration(t, 'redirect'); await prepare_ready_registration(t, 'redirect');
t.add_cleanup(() => registration.unregister()); t.add_cleanup(() => registration.unregister());
promise_rejects(t, new TypeError(), registration.update()) await promise_rejects(t, new TypeError(), registration.update());
assert_active_only(registration, expected_url); assert_active_only(registration, expected_url);
}, 'update() should fail when a response for the main script is redirect.'); }, 'update() should fail when a response for the main script is redirect.');
...@@ -93,7 +93,7 @@ promise_test(async t => { ...@@ -93,7 +93,7 @@ promise_test(async t => {
await prepare_ready_registration(t, 'syntax_error'); await prepare_ready_registration(t, 'syntax_error');
t.add_cleanup(() => registration.unregister()); t.add_cleanup(() => registration.unregister());
promise_rejects(t, new TypeError(), registration.update()); await promise_rejects(t, new TypeError(), registration.update());
assert_active_only(registration, expected_url); assert_active_only(registration, expected_url);
}, 'update() should fail when a new script contains a syntax error.'); }, 'update() should fail when a new script contains a syntax error.');
...@@ -117,7 +117,7 @@ promise_test(async t => { ...@@ -117,7 +117,7 @@ promise_test(async t => {
const frame = await with_iframe(SCOPE); const frame = await with_iframe(SCOPE);
t.add_cleanup(() => frame.remove()); t.add_cleanup(() => frame.remove());
promise_rejects( await promise_rejects(
t, new TypeError(), t, new TypeError(),
Promise.all([registration.unregister(), registration.update()])); Promise.all([registration.unregister(), registration.update()]));
}, 'update() should fail when the pending uninstall flag is set.') }, 'update() should fail when the pending uninstall flag is set.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment