Skip to content

Commit

Permalink
Update tests in web-platform-tests/html/semantics/scripting-1/
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=157026

Reviewed by Darin Adler.

Reimported tests under web-platform-tests/html/semantics/scripting-1/ as of d5a4c5b.

* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/resources/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/w3c-import.log:


Canonical link: https://commits.webkit.org/175166@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Apr 26, 2016
1 parent 7be0011 commit 96cce13
Show file tree
Hide file tree
Showing 79 changed files with 994 additions and 61 deletions.
96 changes: 96 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,99 @@
2016-04-26 Ryosuke Niwa <rniwa@webkit.org>

Update tests in web-platform-tests/html/semantics/scripting-1/
https://bugs.webkit.org/show_bug.cgi?id=157026

Reviewed by Darin Adler.

Reimported tests under web-platform-tests/html/semantics/scripting-1/ as of d5a4c5bdf8a1837b4fcf50bbd2efd4150ddafa99.

* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/resources/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/w3c-import.log:

2016-04-26 Ryosuke Niwa <rniwa@webkit.org>

ASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder::finished
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

PASS Async property on a dynamically-created script is true by default

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Async property on a dynamically-created script is true by default</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test checks the Async property on a dynamically-created script element. By default it should be true." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
test(function() {assert_true(document.createElement("script").async)}, "Async property on a dynamically-created script is true by default");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

PASS Test 'async' attribute are reflected in the async property with setAttribute
PASS Test 'async' attribute are reflected in the async property with removeAttribute

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<title>Changes to the 'async' attribute are reflected in the async property</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test ensures changes to the 'async' attribute are reflected in the async property." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
test(function() {
var s = document.createElement("script");
s.async = false;
s.setAttribute('async', ''); /*Should change s.async to true*/
assert_true(s.async)
}, "Test 'async' attribute are reflected in the async property with setAttribute");

test(function() {
var s = document.createElement("script");
s.async = false;
s.setAttribute('async', ''); /*Should change s.async to true*/
s.removeAttribute('async'); /*Should change s.async to false*/
assert_false(s.async)
}, "Test 'async' attribute are reflected in the async property with removeAttribute");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
21

PASS An async script does not block the parser while downloading

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>An async script does not block the parser while downloading</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test ensures an async script does not block the parser while downloading." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
var t = async_test("An async script does not block the parser while downloading");

function timeout()
{
t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "21")});
t.done();
}

var timer = setTimeout(timeout, 4000);

function log(text)
{
var textNode = document.createTextNode(text);
document.getElementById("testresult").appendChild(textNode);
}
</script>

<span id="testresult"></span>

<script src="log.py?sec=3&id=1" async></script>
<script>
log('2');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
21

PASS async script executes as soon as possible after a download is complete

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>An async script executes as soon as possible after a download is complete</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test ensures an async script executes as soon as possible after a download is complete." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
var t = async_test("async script executes as soon as possible after a download is complete");

function timeout()
{
t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "21")});
t.done();
}

var timer = setTimeout(timeout, 4000);

function log(text)
{
var textNode = document.createTextNode(text);
document.getElementById("testresult").appendChild(textNode);
}
</script>

<span id="testresult"></span>

<script src="log.py?sec=3&id=1" async></script>
<script src="log.py?sec=1&id=2" async></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2134

PASS A script element with both async and defer set should execute asynchronously

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>A script element with both async and defer set should execute asynchronously</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test ensures a script element with both async and defer set should execute asynchronously." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-script-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
var t = async_test("A script element with both async and defer set should execute asynchronously");

function timeout()
{
t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "2134")});
t.done();
}

var timer = setTimeout(timeout, 5000);

function log(text)
{
var textNode = document.createTextNode(text);
document.getElementById("testresult").appendChild(textNode);
}
</script>

<span id="testresult"></span>

<script type="text/javascript" src="log.py?sec=1&id=1" defer async></script>
<script type="text/javascript">log('2');</script>
<script type="text/javascript" src="log.py?sec=3&id=3"></script>
<script type="text/javascript">log('4');</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
321

PASS dynamically created external script executes asynchronously

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>A dynamically created external script executes asynchronously</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta description="This test ensures a dynamically created external script executes asynchronously." />
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="https://html.spec.whatwg.org/multipage/#force-async"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id=log></div>
<script type="text/javascript">
var t = async_test("dynamically created external script executes asynchronously");

function timeout()
{
t.step(function(){ assert_equals(document.getElementById("testresult").innerHTML, "321")});
t.done();
}

var timer = setTimeout(timeout, 4000);

function log(text)
{
var textNode = document.createTextNode(text);
document.getElementById("testresult").appendChild(textNode);
}
</script>

<span id="testresult"></span>
<script type="text/javascript">
var one = document.createElement("script");
one.src="log.py?sec=3&id=1";
document.head.appendChild(one);

var two = document.createElement("script");
two.src="log.py?sec=1&id=2";
document.head.appendChild(two);

log('3');
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
312

PASS Ordered async script execution when script.async == false

Loading

0 comments on commit 96cce13

Please sign in to comment.