Commit b3f3f16b authored by Philip Jägenstedt's avatar Philip Jägenstedt Committed by Commit Bot

Simplify assert_throws in two places where error messages were passed

This was discovered in
https://chromium-review.googlesource.com/c/chromium/src/+/980757 by
letting assert_throws also check that the message matches. That change
itself isn't a good idea, but it's still just as well to use plain
TypeErrors here to not make it seems like more is being tested than in
fact is.

Change-Id: I8f964e9b25cc94942cb86f3ee0017530f230e04a
Reviewed-on: https://chromium-review.googlesource.com/995192Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548060}
parent be3d8853
...@@ -57,7 +57,7 @@ for (const { args, testName } of badRequestArgTests) { ...@@ -57,7 +57,7 @@ for (const { args, testName } of badRequestArgTests) {
// Add signal to 2nd arg // Add signal to 2nd arg
args[1] = args[1] || {}; args[1] = args[1] || {};
args[1].signal = controller.signal; args[1].signal = controller.signal;
await promise_rejects(t, err, fetch(...args)); await promise_rejects(t, new TypeError, fetch(...args));
} }
}, `TypeError from request constructor takes priority - ${testName}`); }, `TypeError from request constructor takes priority - ${testName}`);
} }
......
...@@ -15,9 +15,7 @@ test(function(t) { ...@@ -15,9 +15,7 @@ test(function(t) {
test(function(t) { test(function(t) {
assert_throws( assert_throws(
new TypeError("Failed to execute 'setActionHandler' on 'MediaSession':" + new TypeError,
"The provided value 'invalid' is not a valid enum value" +
"of type MediaSessionAction."),
_ => { window.navigator.mediaSession.setActionHandler("invalid", null); }); _ => { window.navigator.mediaSession.setActionHandler("invalid", null); });
}, "Test that setActionHandler() throws exception for unsupported actions"); }, "Test that setActionHandler() throws exception for unsupported actions");
......
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