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

Side by Side Diff: LayoutTests/media/W3C/w3cwrapper.js

Issue 205893003: Make w3cwrapper.js's done() match the semantics in testharness.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Match Created 6 years, 9 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 | « 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 getVideoURI(dummy) { 1 function getVideoURI(dummy) {
2 var bool=function(any){return!(any=="no"||!any)}; 2 var bool=function(any){return!(any=="no"||!any)};
3 return "../../../content/test." + (bool(document.createElement("video").canPla yType('video/ogg; codecs="theora"')) ? "ogv" : "mp4"); 3 return "../../../content/test." + (bool(document.createElement("video").canPla yType('video/ogg; codecs="theora"')) ? "ogv" : "mp4");
4 } 4 }
5 5
6 function getAudioURI(dummy) { 6 function getAudioURI(dummy) {
7 return "../../../content/test.wav"; 7 return "../../../content/test.wav";
8 } 8 }
9 9
10 function testStep(testFunction){ 10 function testStep(testFunction) {
11 try { 11 try {
12 testFunction(); 12 testFunction();
13 } catch (e) { 13 } catch (e) {
14 testFailed('Aborted with exception: ' + e.message); 14 testFailed('Aborted with exception: ' + e.message);
15 } 15 }
16 } 16 }
17 17
18 function testDone() {
19 // Match the semantics of testharness.js done(), where nothing that
20 // happens after that call has any effect on the test result.
21 if (!window.wasFinishJSTestCalled) {
22 finishJSTest();
23 assert_equals = assert_true = assert_false = function() { };
24 }
25 }
26
18 function test(testFunction) { 27 function test(testFunction) {
19 description(document.title); 28 description(document.title);
20 testStep(testFunction); 29 testStep(testFunction);
21 } 30 }
22 31
23 function async_test(title, options) { 32 function async_test(title, options) {
24 window.jsTestIsAsync = true; 33 window.jsTestIsAsync = true;
25 description(title); 34 description(title);
26 return { 35 return {
27 step: testStep, 36 step: testStep,
28 done: finishJSTest 37 done: testDone
29 } 38 }
30 } 39 }
31 40
32 document.write("<p id=description></p><div id=console></div>"); 41 document.write("<p id=description></p><div id=console></div>");
33 document.write("<script src='../../../../resources/js-test.js'></" + "script>"); 42 document.write("<script src='../../../../resources/js-test.js'></" + "script>");
34 43
35 assert_equals = function(a, b) { shouldBe('"' + a + '"', '"' + b + '"'); } 44 assert_equals = function(a, b) { shouldBe('"' + a + '"', '"' + b + '"'); }
36 assert_true = function(a) { shouldBeTrue("" + a); } 45 assert_true = function(a) { shouldBeTrue("" + a); }
37 assert_false = function(a) { shouldBeFalse("" + a); } 46 assert_false = function(a) { shouldBeFalse("" + a); }
38 47
39 if (window.testRunner) 48 if (window.testRunner)
40 testRunner.dumpAsText(); 49 testRunner.dumpAsText();
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