OLD | NEW |
1 var initialize_InspectorTest = function() { | 1 var initialize_InspectorTest = function() { |
2 | 2 |
3 var results = []; | 3 var results = []; |
4 | 4 |
5 function consoleOutputHook(messageType) | 5 function consoleOutputHook(messageType) |
6 { | 6 { |
7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 7 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
8 } | 8 } |
9 | 9 |
10 window._originalConsoleLog = console.log.bind(console); | 10 window._originalConsoleLog = console.log.bind(console); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 callback = InspectorTest.safeWrap(callback); | 42 callback = InspectorTest.safeWrap(callback); |
43 | 43 |
44 function mycallback(error, result, wasThrown) | 44 function mycallback(error, result, wasThrown) |
45 { | 45 { |
46 if (!error) | 46 if (!error) |
47 callback(InspectorTest.runtimeModel.createRemoteObject(result), wasT
hrown); | 47 callback(InspectorTest.runtimeModel.createRemoteObject(result), wasT
hrown); |
48 } | 48 } |
49 InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback); | 49 InspectorTest.RuntimeAgent.evaluate(code, "console", false, mycallback); |
50 } | 50 } |
51 | 51 |
| 52 InspectorTest.evaluateInPagePromise = function(code) |
| 53 { |
| 54 return new Promise(succ => InspectorTest.evaluateInPage(code, succ)); |
| 55 } |
| 56 |
52 InspectorTest.evaluateInPageWithTimeout = function(code) | 57 InspectorTest.evaluateInPageWithTimeout = function(code) |
53 { | 58 { |
54 // FIXME: we need a better way of waiting for chromium events to happen | 59 // FIXME: we need a better way of waiting for chromium events to happen |
55 InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'), 1
)"); | 60 InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'), 1
)"); |
56 } | 61 } |
57 | 62 |
58 InspectorTest.evaluateFunctionInOverlay = function(func, callback) | 63 InspectorTest.evaluateFunctionInOverlay = function(func, callback) |
59 { | 64 { |
60 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func
+ " + \")()\")"; | 65 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func
+ " + \")()\")"; |
61 var mainContext = InspectorTest.runtimeModel.executionContexts()[0]; | 66 var mainContext = InspectorTest.runtimeModel.executionContexts()[0]; |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 _output("[page] " + text); | 1156 _output("[page] " + text); |
1152 } | 1157 } |
1153 | 1158 |
1154 function _output(result) | 1159 function _output(result) |
1155 { | 1160 { |
1156 if (!outputElement) | 1161 if (!outputElement) |
1157 createOutputElement(); | 1162 createOutputElement(); |
1158 outputElement.appendChild(document.createTextNode(result)); | 1163 outputElement.appendChild(document.createTextNode(result)); |
1159 outputElement.appendChild(document.createElement("br")); | 1164 outputElement.appendChild(document.createElement("br")); |
1160 } | 1165 } |
OLD | NEW |