resource-selection-invoke-pause-networkState.html (894B)
1 <!doctype html> 2 <title>NOT invoking resource selection with pause() when networkState is not NETWORK_EMPTY</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id=log></div> 6 <video></video> 7 <script> 8 var v; 9 var t = async_test(function(t) { 10 v = document.querySelector('video'); 11 v.src = 'data:,'; 12 assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src'); 13 var errorCount = 0; 14 v.onerror = t.step_func(function() { 15 errorCount++; 16 if (errorCount == 1) { 17 assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState in onerror'); 18 v.pause(); // should not invoke RSA. if it does, error will be fired again. 19 } else { 20 assert_unreached(); 21 } 22 }); 23 onload = t.step_func(function() { 24 assert_equals(errorCount, 1, 'errorCount'); 25 t.done(); 26 }); 27 }); 28 </script>