Skip to content

Commit

Permalink
Shadow DOM: Run the next test even if the current fails
Browse files Browse the repository at this point in the history
Part of #11269.
  • Loading branch information
zcorpan authored and domenic committed Jun 26, 2018
1 parent 3aaef8d commit 829ef55
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shadow-dom/Document-prototype-currentScript.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>HTML: Document.prototype.currentScript</title>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<meta name="assert" content="If the script element is in a document, then set the script element's node document's currentScript attribute to the script element.">
Expand All @@ -12,11 +13,16 @@
<div id="log"></div>
<script id="outerScriptElement">

function assert_shadowdom_supported() {
assert_true('attachShadow' in document.createElement('div'), 'Shadow DOM is not supported');
}

var outerScriptElement = document.currentScript;

function testInlineScript(mode)
{
test(function () {
assert_shadowdom_supported();
var host = document.createElement('div');
var shadowRoot = host.attachShadow({mode: mode});
var scriptElement = document.createElement('script');
Expand Down Expand Up @@ -45,7 +51,11 @@

var mode = testCase.mode;

testCase.test.add_cleanup(() => {
setTimeout(executeNextTest, 1);
});
testCase.test.step(function () {
assert_shadowdom_supported();
testedScriptElement = document.createElement('script');
testedScriptElement.src = 'resources/Document-prototype-currentScript-helper.js';

Expand All @@ -67,7 +77,6 @@
assert_equals(document.currentScript, testCase.expected());
});
testCase.test.done();
setTimeout(executeNextTest, 1);
}
}

Expand Down

0 comments on commit 829ef55

Please sign in to comment.