Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

  • This test has a WPT meta file that expects 1 subtest issues.
  • This WPT test may be referenced by the following Test IDs:
    • /html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-candidate-remove-addEventListener.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>removing the candidate source, addEventListener</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
var v;
function createSource(src) {
var source = document.createElement('source');
source.src = src;
return source;
}
var t = async_test(function(t) {
v = document.createElement('video');
v.appendChild(createSource('resources/delayed-broken-video.py')); // invokes resource selection
v.firstChild.addEventListener('error', t.step_func(function() { t.done(); }), false);
});
</script>
<!-- now resource selection algorithm will continue its sync section (the </script> tag below provides a stable state) -->
<!-- the <source> is candidate -->
<!-- pointer is between the <source> and the end of the list -->
<script>
t.step(function() {
v.removeChild(v.firstChild); // tests that we fire 'error' on it despite being removed
});
</script>