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

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

Issue 17395006: Fix LayoutTests that assume canplay, playing, and canplaythrough will only fire once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix event-attributes expectations. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/media/video-seeking-expected.txt ('k') | 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 1
2 var video = null; 2 var video = null;
3 var mediaElement = document; // If not set, an event from any element will trigg er a waitForEvent() callback. 3 var mediaElement = document; // If not set, an event from any element will trigg er a waitForEvent() callback.
4 var console = null; 4 var console = null;
5 var printFullTestDetails = true; // This is optionaly switched of by test whose tested values can differ. (see disableFullTestDetailsPrinting()) 5 var printFullTestDetails = true; // This is optionaly switched of by test whose tested values can differ. (see disableFullTestDetailsPrinting())
6 var Failed = false; 6 var Failed = false;
7 7
8 var track = null; // Current TextTrack being tested. 8 var track = null; // Current TextTrack being tested.
9 var cues = null; // Current TextTrackCueList being tested. 9 var cues = null; // Current TextTrackCueList being tested.
10 var numberOfTrackTests = 0; 10 var numberOfTrackTests = 0;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 function run(testFuncString) 141 function run(testFuncString)
142 { 142 {
143 consoleWrite("RUN(" + testFuncString + ")"); 143 consoleWrite("RUN(" + testFuncString + ")");
144 try { 144 try {
145 eval(testFuncString); 145 eval(testFuncString);
146 } catch (ex) { 146 } catch (ex) {
147 consoleWrite(ex); 147 consoleWrite(ex);
148 } 148 }
149 } 149 }
150 150
151 function waitForEventOnce(eventName, func, endit) 151 function waitForEventOnce(eventName, func, endit, doNotLog)
152 { 152 {
153 waitForEvent(eventName, func, endit, true) 153 waitForEvent(eventName, func, endit, true, null, doNotLog)
154 } 154 }
155 155
156 function waitForEventAndEnd(eventName, funcString) 156 function waitForEventAndEnd(eventName, funcString)
157 { 157 {
158 waitForEvent(eventName, funcString, true) 158 waitForEvent(eventName, funcString, true, false, null, false)
159 } 159 }
160 160
161 function waitForEvent(eventName, func, endit, oneTimeOnly, element) 161 function waitForEvent(eventName, func, endit, oneTimeOnly, element, doNotLog)
162 { 162 {
163 if (!element) 163 if (!element)
164 element = mediaElement; 164 element = mediaElement;
165 165
166 function _eventCallback(event) 166 function _eventCallback(event)
167 { 167 {
168 if (oneTimeOnly) 168 if (oneTimeOnly)
169 element.removeEventListener(eventName, _eventCallback, true); 169 element.removeEventListener(eventName, _eventCallback, true);
170 170
171 consoleWrite("EVENT(" + eventName + ")"); 171 if (!doNotLog)
172 consoleWrite("EVENT(" + eventName + ")");
172 173
173 if (func) 174 if (func)
174 func(event); 175 func(event);
175 176
176 if (endit) 177 if (endit)
177 endTest(); 178 endTest();
178 } 179 }
179 180
180 element.addEventListener(eventName, _eventCallback, true); 181 element.addEventListener(eventName, _eventCallback, true);
181 } 182 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 352
352 func(); 353 func();
353 } 354 }
354 355
355 requiredEvents = []; 356 requiredEvents = [];
356 for (var i = 0; i < eventList.length; i++) { 357 for (var i = 0; i < eventList.length; i++) {
357 requiredEvents[i] = eventList[i][1]; 358 requiredEvents[i] = eventList[i][1];
358 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true ); 359 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true );
359 } 360 }
360 } 361 }
OLDNEW
« no previous file with comments | « LayoutTests/media/video-seeking-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698