OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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) + ")"); |
philipj_slow
2014/04/04 14:54:33
Unrelated change?
Brendan Long
2014/04/04 15:07:22
This was necessary to make the test not crash if i
| |
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 + ")"); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 | 358 |
358 func(); | 359 func(); |
359 } | 360 } |
360 | 361 |
361 requiredEvents = []; | 362 requiredEvents = []; |
362 for (var i = 0; i < eventList.length; i++) { | 363 for (var i = 0; i < eventList.length; i++) { |
363 requiredEvents[i] = eventList[i][1]; | 364 requiredEvents[i] = eventList[i][1]; |
364 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true ); | 365 eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true ); |
365 } | 366 } |
366 } | 367 } |
OLD | NEW |