Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-resumes-onload.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>resource selection should not delay the load event indefinitely</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<video></video>
<script>
async_test(function(t) {
const v = document.querySelector('video');
v.onloadstart = t.unreached_func("loadstart event should not be fired when the resource selection algorithm cannot determine mode");
const s = document.createElement('source');
v.appendChild(s); // this will trigger resource selection
v.removeChild(s); // force an early return in resource selection algorithm
window.onload = t.step_func_done(function() {
assert_equals(v.networkState, v.NETWORK_EMPTY);
});
});
</script>