Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Tests that preload is overridden to none for cellular connections.</title > | |
|
philipj_slow
2015/10/01 09:24:07
Since this test is almost identical, what you coul
DaleCurtis
2015/10/20 21:56:51
Kind of done; refactored to a shared js, but async
| |
| 3 <style> | |
| 4 /* Use a black background to see failures; the video clip is a white square. */ | |
| 5 body { background-color: black; } | |
| 6 </style> | |
| 7 <script> | |
| 8 if (window.testRunner) | |
| 9 testRunner.waitUntilDone(); | |
| 10 | |
| 11 function startTest() { | |
| 12 if (window.internals) { | |
| 13 internals.setNetworkStateNotifierTestOnly(true); | |
| 14 internals.setNetworkConnectionInfo('cellular', 2.0); | |
| 15 } | |
| 16 | |
| 17 var video = document.querySelector('video'); | |
| 18 video.addEventListener("suspend", function () { | |
| 19 if (window.internals) | |
| 20 internals.setNetworkStateNotifierTestOnly(false); | |
| 21 | |
| 22 if (window.testRunner) | |
| 23 testRunner.notifyDone(); | |
| 24 }); | |
| 25 | |
| 26 video.src = "resources/test-positive-start-time.webm" | |
| 27 } | |
| 28 | |
| 29 window.addEventListener('load', startTest, false); | |
| 30 </script> | |
| 31 <video preload="metadata"></video> | |
| OLD | NEW |