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

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

Issue 224833002: Implement DataCue interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove text attribute Created 6 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 var success = false; 81 var success = false;
82 switch (comparison) 82 switch (comparison)
83 { 83 {
84 case '<': success = observed < expected; break; 84 case '<': success = observed < expected; break;
85 case '<=': success = observed <= expected; break; 85 case '<=': success = observed <= expected; break;
86 case '>': success = observed > expected; break; 86 case '>': success = observed > expected; break;
87 case '>=': success = observed >= expected; break; 87 case '>=': success = observed >= expected; break;
88 case '!=': success = observed != expected; break; 88 case '!=': success = observed != expected; break;
89 case '==': success = observed == expected; break; 89 case '==': success = observed == expected; break;
90 case '===': success = observed === expected; break; 90 case '===': success = observed === expected; break;
91 case 'instanceof': success = observed instanceof expected; break;
91 } 92 }
92 93
93 reportExpected(success, testFuncString, comparison, expected, observed) 94 reportExpected(success, testFuncString, comparison, expected, observed)
94 } 95 }
95 96
96 function testArraysEqual(testFuncString, expected) 97 function testArraysEqual(testFuncString, expected)
97 { 98 {
98 var observed; 99 var observed;
99 try { 100 try {
100 observed = eval(testFuncString); 101 observed = eval(testFuncString);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 210 }
210 211
211 function testDOMException(testString, exceptionString) 212 function testDOMException(testString, exceptionString)
212 { 213 {
213 try { 214 try {
214 eval(testString); 215 eval(testString);
215 } catch (ex) { 216 } catch (ex) {
216 var exception = ex; 217 var exception = ex;
217 } 218 }
218 logResult(exception instanceof DOMException && exception.code === eval(excep tionString), 219 logResult(exception instanceof DOMException && exception.code === eval(excep tionString),
219 "TEST(" + testString + ") THROWS(" + exceptionString + ": " + exception. message + ")"); 220 "TEST(" + testString + ") THROWS(" + exceptionString + ": " + (exception ? exception.message : undefined) + ")");
220 } 221 }
221 222
222 function testException(testString, exceptionString) { 223 function testException(testString, exceptionString) {
223 try { 224 try {
224 eval(testString); 225 eval(testString);
225 } catch (ex) { 226 } catch (ex) {
226 var exception = ex; 227 var exception = ex;
227 } 228 }
228 logResult(exception !== undefined && exception == eval(exceptionString), 229 logResult(exception !== undefined && exception == eval(exceptionString),
229 "TEST(" + testString + ") THROWS(" + exceptionString + ")"); 230 "TEST(" + testString + ") THROWS(" + exceptionString + ")");
230 } 231 }
231 232
233 function testExceptionType(testString, exceptionTypeString) {
234 try {
235 eval(testString);
236 } catch (ex) {
237 var exception = ex;
238 }
239 logResult(exception instanceof eval(exceptionTypeString),
240 "TEST(" + testString + ") THROWS(" + exceptionTypeString + ")");
241 }
242
232 var testEnded = false; 243 var testEnded = false;
233 244
234 function endTest() 245 function endTest()
235 { 246 {
236 consoleWrite("END OF TEST"); 247 consoleWrite("END OF TEST");
237 testEnded = true; 248 testEnded = true;
238 if (window.testRunner) 249 if (window.testRunner)
239 testRunner.notifyDone(); 250 testRunner.notifyDone();
240 } 251 }
241 252
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 368
358 func(); 369 func();
359 } 370 }
360 371
361 requiredEvents = []; 372 requiredEvents = [];
362 for (var i = 0; i < eventList.length; i++) { 373 for (var i = 0; i < eventList.length; i++) {
363 requiredEvents[i] = eventList[i][1]; 374 requiredEvents[i] = eventList[i][1];
364 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true ); 375 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true );
365 } 376 }
366 } 377 }
OLDNEW
« no previous file with comments | « LayoutTests/media/track/track-datacue-expected.txt ('k') | Source/bindings/v8/custom/V8TextTrackCueCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698