Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error type test for attachShadow() #16853

Merged
merged 1 commit into from
May 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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