Commit 365fdc7e authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Replace some "assert_throws({'name': 'domerror'}, stuff)" with assert_throws_dom

This diff was generated by running:

  find . -type f -print0 | xargs -0 perl -pi -e "BEGIN { \$/ = undef; } s/assert_throws\(([ \n]*)\{ *[\"']?name[\"']? *: *(['\"](?:InvalidStateError|SyntaxError|NotSupportedError|DataError|SecurityError)[\"']) *\} *(, *.)/assert_throws_dom(\1\2\3/gs"

Bug: 1051932
Change-Id: I44382930e4eee93daeb806acf4011ab0430965ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078798
Commit-Queue: Luke Z <lpz@chromium.org>
Auto-Submit: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745469}
parent e1e267ea
......@@ -570,7 +570,7 @@
{
mediaSource.removeSourceBuffer(sourceBuffer);
assert_throws( { name: 'InvalidStateError'} ,
assert_throws_dom( 'InvalidStateError',
function() { sourceBuffer.appendBuffer(mediaData); },
'appendBuffer() throws an exception when called after removeSourceBuffer().');
test.done();
......
......@@ -8,7 +8,7 @@
<meta charset='utf-8'>
<script>
window.top.test(function() {
window.top.assert_throws({name: 'SecurityError'}, function() {
window.top.assert_throws_dom('SecurityError', function() {
new PaymentRequest([{supportedMethods: ['foo']}], {total: {label: 'label', amount: {currency: 'USD', value: '5.00'}}});
}, 'If the browsing context of the script calling the constructor is not a top-level browsing context, then throw a SecurityError.');
});
......
......@@ -8,7 +8,7 @@
<meta charset='utf-8'>
<script>
window.top.test(function() {
window.top.assert_throws({name: 'SecurityError'}, function() {
window.top.assert_throws_dom('SecurityError', function() {
new PaymentRequest([{supportedMethods: ['foo']}], {total: {label: 'label', amount: {currency: 'USD', value: '5.00'}}});
}, 'If the ancestor iframe does not specify allowpaymentrequest, then throw a SecurityError.');
});
......
......@@ -39,7 +39,7 @@ test(() => {
return;
}
['open', 'closed'].forEach((mode) => {
assert_throws({name: 'NotSupportedError'}, () => {
assert_throws_dom('NotSupportedError', () => {
element.attachShadow({mode: mode});
}), 'attachShadow should throw NotSupportdeError for ' + maybeTagName;
});
......
......@@ -22,9 +22,9 @@ test(() => {
assert_throws({name: 'TypeError'}, () => { host3.attachShadow({mode: 'illegal'}); },
'Attach shadow root whose mode is neither open nor closed should throw TypeError.');
assert_throws({name: 'NotSupportedError'}, () => { host1.attachShadow({mode: 'open'}); },
assert_throws_dom('NotSupportedError', () => { host1.attachShadow({mode: 'open'}); },
'Attach shadow on a host which has open shadow root will raise NotSupportedError exception.');
assert_throws({name: 'NotSupportedError'}, () => { host2.attachShadow({mode: 'open'}); },
assert_throws_dom('NotSupportedError', () => { host2.attachShadow({mode: 'open'}); },
'Attach shadow on a host wich has closed shadow root will raise NotSupportedError exception.');
}, 'Test for Element.attachShadow() with mode parameter.');
</script>
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