summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-resumes-onload.html
blob: b166763d14f560013fdfd4bf0be25b5e725da2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!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>