Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: content/test/data/gpu/pixel_video_mp4.html

Issue 2803823005: Check for readyState in video pixel tests (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/test/data/gpu/pixel_video_vp9.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 2
3 <!-- READ BEFORE UPDATING: 3 <!-- READ BEFORE UPDATING:
4 If this test is updated make sure to increment the "revision" value of the 4 If this test is updated make sure to increment the "revision" value of the
5 associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure 5 associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
6 that the baseline images are regenerated on the next run. 6 that the baseline images are regenerated on the next run.
7 --> 7 -->
8 8
9 <html> 9 <html>
10 <head> 10 <head>
11 <title>MP4 Video test</title> 11 <title>MP4 Video test</title>
12 <style type="text/css"> 12 <style type="text/css">
13 .nomargin { 13 .nomargin {
14 margin: 0px auto; 14 margin: 0px auto;
15 } 15 }
16 </style> 16 </style>
17 <script> 17 <script>
18 var g_swapsBeforeAck = 15; 18 var g_swapsBeforeAck = 15;
19 var video; 19 var video;
20 20
21 function main() 21 function main()
22 { 22 {
23 video = document.getElementById("video"); 23 video = document.getElementById("video");
24 video.addEventListener('canplaythrough', waitForFinish, true); 24 if (video.readyState >= 4) {
25 waitForFinish();
26 } else {
27 video.addEventListener('canplaythrough', waitForFinish, true);
28 }
25 } 29 }
26 30
27 function waitForFinish() 31 function waitForFinish()
28 { 32 {
29 if (g_swapsBeforeAck == 0) { 33 if (g_swapsBeforeAck == 0) {
30 domAutomationController.setAutomationId(1); 34 domAutomationController.setAutomationId(1);
31 domAutomationController.send("SUCCESS"); 35 domAutomationController.send("SUCCESS");
32 } else { 36 } else {
33 g_swapsBeforeAck--; 37 g_swapsBeforeAck--;
34 window.requestAnimationFrame(waitForFinish); 38 window.requestAnimationFrame(waitForFinish);
35 } 39 }
36 } 40 }
37 </script> 41 </script>
38 </head> 42 </head>
39 <body onload="main()"> 43 <body onload="main()">
40 <div id="container" style="position:absolute; top:0px; left:0px"> 44 <div id="container" style="position:absolute; top:0px; left:0px">
41 <video class="nomargin" id="video"> 45 <video class="nomargin" id="video">
42 <source src="/media/test/data/bear.mp4" type="video/mp4"> 46 <source src="/media/test/data/bear.mp4" type="video/mp4">
43 </video> 47 </video>
44 </div> 48 </div>
45 </body> 49 </body>
46 </html> 50 </html>
OLDNEW
« no previous file with comments | « no previous file | content/test/data/gpu/pixel_video_vp9.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698