-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test inserting a script and a source in a media element
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
dom/nodes/Node-appendChild-script-and-source-from-fragment.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>Node.appendChild: inserting script and source from a fragment</title> | ||
<link rel=help href="https://dom.spec.whatwg.org/#dom-node-appendChild"> | ||
<link rel=help href="https://dom.spec.whatwg.org/#concept-node-insert"> | ||
<link rel=help href="https://github.com/whatwg/dom/issues/575"> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<div id="log"></div> | ||
</head> | ||
<body> | ||
<video id="media"></video> | ||
<script> | ||
var media = document.getElementById("media"); | ||
|
||
var source = document.createElement("source"); | ||
|
||
var script = document.createElement("script"); | ||
var scriptRan = false; | ||
script.textContent = ` | ||
assert_equals( | ||
media.networkState, | ||
HTMLMediaElement.NETWORK_NO_SOURCE, | ||
"resource selection did not start", | ||
); | ||
scriptRan = true; | ||
`; | ||
|
||
var df = document.createDocumentFragment(); | ||
df.appendChild(script); | ||
df.appendChild(source); | ||
|
||
assert_false(scriptRan, "script ran"); | ||
media.appendChild(df); | ||
assert_true(scriptRan, "script has not run"); | ||
done(); | ||
</script> |