| OLD | NEW |
| 1 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results | 1 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results |
| 2 if (self.testRunner) { | 2 if (self.testRunner) { |
| 3 if (self.enablePixelTesting) | 3 if (self.enablePixelTesting) |
| 4 testRunner.dumpAsTextWithPixelResults(); | 4 testRunner.dumpAsTextWithPixelResults(); |
| 5 else | 5 else |
| 6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
| 7 } | 7 } |
| 8 | 8 |
| 9 var description, debug, successfullyParsed, errorMessage; | 9 var description, debug, successfullyParsed, errorMessage; |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 "font-family: monospace;" + | 66 "font-family: monospace;" + |
| 67 "}"; | 67 "}"; |
| 68 | 68 |
| 69 function insertStyleSheet() | 69 function insertStyleSheet() |
| 70 { | 70 { |
| 71 var styleElement = document.createElement("style"); | 71 var styleElement = document.createElement("style"); |
| 72 styleElement.textContent = css; | 72 styleElement.textContent = css; |
| 73 (document.head || document.documentElement).appendChild(styleElement); | 73 (document.head || document.documentElement).appendChild(styleElement); |
| 74 } | 74 } |
| 75 | 75 |
| 76 if (!isWorker()) | 76 function handleTestFinished() |
| 77 { |
| 78 // FIXME: Get rid of this boolean. |
| 79 wasPostTestScriptParsed = true; |
| 80 if (window.jsTestIsAsync) { |
| 81 if (window.testRunner) |
| 82 testRunner.waitUntilDone(); |
| 83 if (window.wasFinishJSTestCalled) |
| 84 finishJSTest(); |
| 85 } else |
| 86 finishJSTest(); |
| 87 } |
| 88 |
| 89 if (!isWorker()) { |
| 90 window.addEventListener('DOMContentLoaded', handleTestFinished, false); |
| 77 insertStyleSheet(); | 91 insertStyleSheet(); |
| 92 } |
| 78 | 93 |
| 79 if (!self.isOnErrorTest) { | 94 if (!self.isOnErrorTest) { |
| 80 self.onerror = function(message) | 95 self.onerror = function(message) |
| 81 { | 96 { |
| 82 errorMessage = message; | 97 errorMessage = message; |
| 83 }; | 98 }; |
| 84 } | 99 } |
| 85 | |
| 86 })(); | 100 })(); |
| 87 | 101 |
| 88 function isWorker() | 102 function isWorker() |
| 89 { | 103 { |
| 90 // It's conceivable that someone would stub out 'document' in a worker so | 104 // It's conceivable that someone would stub out 'document' in a worker so |
| 91 // also check for childNodes, an arbitrary DOM-related object that is | 105 // also check for childNodes, an arbitrary DOM-related object that is |
| 92 // meaningless in a WorkerContext. | 106 // meaningless in a WorkerContext. |
| 93 return (typeof document === 'undefined' || typeof document.childNodes === 'u
ndefined') && !!self.importScripts; | 107 return (typeof document === 'undefined' || typeof document.childNodes === 'u
ndefined') && !!self.importScripts; |
| 94 } | 108 } |
| 95 | 109 |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 testPassed = function(msg) { | 685 testPassed = function(msg) { |
| 672 workerPort.postMessage('PASS:' + msg); | 686 workerPort.postMessage('PASS:' + msg); |
| 673 } | 687 } |
| 674 finishJSTest = function() { | 688 finishJSTest = function() { |
| 675 workerPort.postMessage('DONE:'); | 689 workerPort.postMessage('DONE:'); |
| 676 } | 690 } |
| 677 debug = function(msg) { | 691 debug = function(msg) { |
| 678 workerPort.postMessage(msg); | 692 workerPort.postMessage(msg); |
| 679 } | 693 } |
| 680 } | 694 } |
| OLD | NEW |