Skip to content

Commit

Permalink
Update error type test for attachShadow()
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic authored and Marcos Cáceres committed Jul 23, 2019
1 parent d98eed3 commit 79c4bc9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shadow-dom/Element-interface-attachShadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,30 @@
}, 'Element.attachShadow must create an instance of ShadowRoot');

test(function () {
assert_throws({'name': 'InvalidStateError'}, function () {
assert_throws({'name': 'NotSupportedError'}, function () {
var div = document.createElement('div');
div.attachShadow({mode: "open"});
div.attachShadow({mode: "open"});
}, 'Calling attachShadow({mode: "open"}) twice on the same element must throw');

assert_throws({'name': 'InvalidStateError'}, function () {
assert_throws({'name': 'NotSupportedError'}, function () {
var div = document.createElement('div');
div.attachShadow({mode: "closed"});
div.attachShadow({mode: "closed"});
}, 'Calling attachShadow({mode: "closed"}) twice on the same element must throw');

assert_throws({'name': 'InvalidStateError'}, function () {
assert_throws({'name': 'NotSupportedError'}, function () {
var div = document.createElement('div');
div.attachShadow({mode: "open"});
div.attachShadow({mode: "closed"});
}, 'Calling attachShadow({mode: "closed"}) after attachShadow({mode: "open"}) on the same element must throw');

assert_throws({'name': 'InvalidStateError'}, function () {
assert_throws({'name': 'NotSupportedError'}, function () {
var div = document.createElement('div');
div.attachShadow({mode: "closed"});
div.attachShadow({mode: "open"});
}, 'Calling attachShadow({mode: "open"}) after attachShadow({mode: "closed"}) on the same element must throw');
}, 'Element.attachShadow must throw a InvalidStateError if the context object already hosts a shadow tree');
}, 'Element.attachShadow must throw a NotSupportedError if the context object already hosts a shadow tree');

test(function () {
for (var elementName of ATTACHSHADOW_DISALLOWED_ELEMENTS) {
Expand Down

0 comments on commit 79c4bc9

Please sign in to comment.