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

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

Issue 2053793002: 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.notifyDone(); 25 testRunner.layoutAndPaintAsyncThen(function() {
26 testRunner.notifyDone();
27 });
28 }
26 }); 29 });
27 }); 30 });
28 } 31 }
29 32
30 if (window.testRunner) { 33 if (window.testRunner) {
31 testRunner.waitUntilDone(); 34 testRunner.waitUntilDone();
32 setTimeout(function() { 35 setTimeout(function() {
33 document.body.appendChild(document.createTextNode('FAIL')); 36 document.body.appendChild(document.createTextNode('FAIL'));
34 if (window.testRunner) 37 if (window.testRunner)
35 testRunner.notifyDone(); 38 testRunner.notifyDone();
(...skipping 22 matching lines...) Expand all
58 61
59 function initAndSeeked() 62 function initAndSeeked()
60 { 63 {
61 var videos = document.getElementsByTagName('video'); 64 var videos = document.getElementsByTagName('video');
62 65
63 waitForMultipleEvents("seeked", videos.length, function() { 66 waitForMultipleEvents("seeked", videos.length, function() {
64 if (window.testRunner) 67 if (window.testRunner)
65 testRunner.notifyDone(); 68 testRunner.notifyDone();
66 }); 69 });
67 } 70 }
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