Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that disables it given conditions:
- debug and (os == "linux") and (processor == "x86") : https://bugzilla.mozilla.org/show_bug.cgi?id=1482405
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-set-src-networkState.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>invoking load by setting src when networkState is not NETWORK_EMPTY</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function(t) {
var v = document.createElement('video');
v.play().catch(() => {}); // invokes resource selection and sets .paused to false
assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState');
assert_false(v.paused, 'paused');
v.setAttribute('src', ''); // invokes media load which sets .paused to true
assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
assert_true(v.paused, 'paused after setting src');
});
</script>