OLD | NEW |
1 if (window.GCController) | 1 if (window.GCController) |
2 GCController.collectAll(); | 2 GCController.collectAll(); |
3 | 3 |
4 var initialize_InspectorTest = function() { | 4 var initialize_InspectorTest = function() { |
5 Protocol.InspectorBackend.Options.suppressRequestErrors = true; | 5 Protocol.InspectorBackend.Options.suppressRequestErrors = true; |
6 var results = []; | 6 var results = []; |
7 | 7 |
8 function consoleOutputHook(messageType) | 8 function consoleOutputHook(messageType) |
9 { | 9 { |
10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func
+ " + \")()\")"; | 122 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func
+ " + \")()\")"; |
123 var mainContext = InspectorTest.runtimeModel.executionContexts()[0]; | 123 var mainContext = InspectorTest.runtimeModel.executionContexts()[0]; |
124 mainContext.evaluate(expression, "", false, false, true, false, false, wrapC
allback); | 124 mainContext.evaluate(expression, "", false, false, true, false, false, wrapC
allback); |
125 | 125 |
126 function wrapCallback(result, exceptionDetails) | 126 function wrapCallback(result, exceptionDetails) |
127 { | 127 { |
128 callback(result.value) | 128 callback(result.value) |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
| 132 InspectorTest.callFunctionInPageOnRemoteObjectAsync = function(remoteObject, cod
e) |
| 133 { |
| 134 return new Promise((success, fail) => { |
| 135 InspectorTest.RuntimeAgent.callFunctionOn( |
| 136 remoteObject.objectId, |
| 137 'function() {' + code + '}', |
| 138 [], // arguments |
| 139 false, // silent |
| 140 undefined, // returnByValue |
| 141 undefined, // generatePreview |
| 142 undefined, // userGesture |
| 143 undefined, // awaitPromise |
| 144 (error, result, exceptionDetails) => { |
| 145 if (error || !!exceptionDetails) { |
| 146 fail(error || result.description); |
| 147 return; |
| 148 } |
| 149 success(InspectorTest.runtimeModel.createRemoteObject(result)); |
| 150 }); |
| 151 }); |
| 152 } |
| 153 |
132 InspectorTest.check = function(passCondition, failureText) | 154 InspectorTest.check = function(passCondition, failureText) |
133 { | 155 { |
134 if (!passCondition) | 156 if (!passCondition) |
135 InspectorTest.addResult("FAIL: " + failureText); | 157 InspectorTest.addResult("FAIL: " + failureText); |
136 } | 158 } |
137 | 159 |
138 InspectorTest.addResult = function(text) | 160 InspectorTest.addResult = function(text) |
139 { | 161 { |
140 results.push(String(text)); | 162 results.push(String(text)); |
141 } | 163 } |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 _output("[page] " + text); | 1268 _output("[page] " + text); |
1247 } | 1269 } |
1248 | 1270 |
1249 function _output(result) | 1271 function _output(result) |
1250 { | 1272 { |
1251 if (!outputElement) | 1273 if (!outputElement) |
1252 createOutputElement(); | 1274 createOutputElement(); |
1253 outputElement.appendChild(document.createTextNode(result)); | 1275 outputElement.appendChild(document.createTextNode(result)); |
1254 outputElement.appendChild(document.createElement("br")); | 1276 outputElement.appendChild(document.createElement("br")); |
1255 } | 1277 } |
OLD | NEW |