OLD | NEW |
1 var initialize_InspectorTest = function() { | 1 var initialize_InspectorTest = function() { |
2 | 2 |
3 var results = []; | 3 var results = []; |
4 var resultsSynchronized = false; | 4 var resultsSynchronized = false; |
5 | 5 |
6 function consoleOutputHook(messageType) | 6 function consoleOutputHook(messageType) |
7 { | 7 { |
8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
9 } | 9 } |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 InspectorTest.check = function(passCondition, failureText) | 96 InspectorTest.check = function(passCondition, failureText) |
97 { | 97 { |
98 if (!passCondition) | 98 if (!passCondition) |
99 InspectorTest.addResult("FAIL: " + failureText); | 99 InspectorTest.addResult("FAIL: " + failureText); |
100 } | 100 } |
101 | 101 |
102 InspectorTest.addResult = function(text) | 102 InspectorTest.addResult = function(text) |
103 { | 103 { |
104 if (InspectorTest._resultBufferring) { | |
105 InspectorTest._resultBufferringContent += text + "\n"; | |
106 return; | |
107 } | |
108 results.push(text); | 104 results.push(text); |
109 if (resultsSynchronized) | 105 if (resultsSynchronized) |
110 InspectorTest.Output.addResult(text); | 106 InspectorTest.Output.addResult(text); |
111 else { | 107 else { |
112 InspectorTest.Output.clearResults(); | 108 InspectorTest.Output.clearResults(); |
113 for (var i = 0; i < results.length; ++i) | 109 for (var i = 0; i < results.length; ++i) |
114 InspectorTest.Output.addResult(results[i]); | 110 InspectorTest.Output.addResult(results[i]); |
115 resultsSynchronized = true; | 111 resultsSynchronized = true; |
116 } | 112 } |
117 } | 113 } |
118 | 114 |
119 InspectorTest.beginResultBufferring = function() | |
120 { | |
121 InspectorTest._resultBufferring = true; | |
122 InspectorTest._resultBufferringContent = ""; | |
123 } | |
124 | |
125 InspectorTest.endResultBufferring = function() | |
126 { | |
127 var result = InspectorTest._resultBufferringContent || ""; | |
128 delete InspectorTest._resultBufferring; | |
129 delete InspectorTest._resultBufferringContent; | |
130 return result; | |
131 } | |
132 | |
133 InspectorTest.addResults = function(textArray) | 115 InspectorTest.addResults = function(textArray) |
134 { | 116 { |
135 if (!textArray) | 117 if (!textArray) |
136 return; | 118 return; |
137 for (var i = 0, size = textArray.length; i < size; ++i) | 119 for (var i = 0, size = textArray.length; i < size; ++i) |
138 InspectorTest.addResult(textArray[i]); | 120 InspectorTest.addResult(textArray[i]); |
139 } | 121 } |
140 | 122 |
141 function onError(event) | 123 function onError(event) |
142 { | 124 { |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 evaluateInWebInspector: function(callId, script) | 641 evaluateInWebInspector: function(callId, script) |
660 { | 642 { |
661 window.opener.postMessage(["evaluateInWebInspector", callId, script], "*
"); | 643 window.opener.postMessage(["evaluateInWebInspector", callId, script], "*
"); |
662 }, | 644 }, |
663 | 645 |
664 display: function() { } | 646 display: function() { } |
665 } | 647 } |
666 | 648 |
667 if (!window.testRunner && window.opener) | 649 if (!window.testRunner && window.opener) |
668 window.testRunner = new StandaloneTestRunnerStub(); | 650 window.testRunner = new StandaloneTestRunnerStub(); |
OLD | NEW |