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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-paint-test.js

Issue 2057193002: Revert of Attempt to deflake video-layer-crash.html. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function waitForMultipleEvents(name, times, func) { 1 function waitForMultipleEvents(name, times, func) {
2 var count = 0; 2 var count = 0;
3 document.addEventListener(name, function() { 3 document.addEventListener(name, function() {
4 if (++count == times) { 4 if (++count == times) {
5 func(); 5 func();
6 } 6 }
7 }, true); 7 }, true);
8 } 8 }
9 9
10 function init() 10 function init()
11 { 11 {
12 var videos = document.getElementsByTagName('video'); 12 var videos = document.getElementsByTagName('video');
13 13
14 waitForMultipleEvents("canplaythrough", videos.length, function() { 14 waitForMultipleEvents("canplaythrough", videos.length, function() {
15 for (var i = 0; i < videos.length; ++i) { 15 for (var i = 0; i < videos.length; ++i) {
16 videos[i].play(); 16 videos[i].play();
17 videos[i].addEventListener("playing", function(event) { 17 videos[i].addEventListener("playing", function(event) {
18 event.target.pause(); 18 event.target.pause();
19 event.target.currentTime = 0; 19 event.target.currentTime = 0;
20 }); 20 });
21 } 21 }
22 22
23 waitForMultipleEvents("seeked", videos.length, function() { 23 waitForMultipleEvents("seeked", videos.length, function() {
24 if (window.testRunner) { 24 if (window.testRunner)
25 testRunner.layoutAndPaintAsyncThen(function() { 25 testRunner.notifyDone();
26 testRunner.notifyDone();
27 });
28 }
29 }); 26 });
30 }); 27 });
31 } 28 }
32 29
33 if (window.testRunner) { 30 if (window.testRunner) {
34 testRunner.waitUntilDone(); 31 testRunner.waitUntilDone();
35 setTimeout(function() { 32 setTimeout(function() {
36 document.body.appendChild(document.createTextNode('FAIL')); 33 document.body.appendChild(document.createTextNode('FAIL'));
37 if (window.testRunner) 34 if (window.testRunner)
38 testRunner.notifyDone(); 35 testRunner.notifyDone();
(...skipping 22 matching lines...) Expand all
61 58
62 function initAndSeeked() 59 function initAndSeeked()
63 { 60 {
64 var videos = document.getElementsByTagName('video'); 61 var videos = document.getElementsByTagName('video');
65 62
66 waitForMultipleEvents("seeked", videos.length, function() { 63 waitForMultipleEvents("seeked", videos.length, function() {
67 if (window.testRunner) 64 if (window.testRunner)
68 testRunner.notifyDone(); 65 testRunner.notifyDone();
69 }); 66 });
70 } 67 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698