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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2236033002: [DevTools] Simplify evaluation callbacks on frontend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-was-thrown
Patch Set: addressed comments Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (window.GCController) 1 if (window.GCController)
2 GCController.collectAll(); 2 GCController.collectAll();
3 var initialize_InspectorTest = function() { 3 var initialize_InspectorTest = function() {
4 4
5 var results = []; 5 var results = [];
6 6
7 function consoleOutputHook(messageType) 7 function consoleOutputHook(messageType)
8 { 8 {
9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); 9 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1));
10 } 10 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // FIXME: we need a better way of waiting for chromium events to happen 97 // FIXME: we need a better way of waiting for chromium events to happen
98 InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'), 1 )"); 98 InspectorTest.evaluateInPage("setTimeout(unescape('" + escape(code) + "'), 1 )");
99 } 99 }
100 100
101 InspectorTest.evaluateFunctionInOverlay = function(func, callback) 101 InspectorTest.evaluateFunctionInOverlay = function(func, callback)
102 { 102 {
103 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func + " + \")()\")"; 103 var expression = "testRunner.evaluateInWebInspectorOverlay(\"(\" + " + func + " + \")()\")";
104 var mainContext = InspectorTest.runtimeModel.executionContexts()[0]; 104 var mainContext = InspectorTest.runtimeModel.executionContexts()[0];
105 mainContext.evaluate(expression, "", false, false, true, false, false, wrapC allback); 105 mainContext.evaluate(expression, "", false, false, true, false, false, wrapC allback);
106 106
107 function wrapCallback(val, err, result) 107 function wrapCallback(result, exceptionDetails)
108 { 108 {
109 callback(result.value) 109 callback(result.value)
110 } 110 }
111 } 111 }
112 112
113 InspectorTest.check = function(passCondition, failureText) 113 InspectorTest.check = function(passCondition, failureText)
114 { 114 {
115 if (!passCondition) 115 if (!passCondition)
116 InspectorTest.addResult("FAIL: " + failureText); 116 InspectorTest.addResult("FAIL: " + failureText);
117 } 117 }
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 _output("[page] " + text); 1145 _output("[page] " + text);
1146 } 1146 }
1147 1147
1148 function _output(result) 1148 function _output(result)
1149 { 1149 {
1150 if (!outputElement) 1150 if (!outputElement)
1151 createOutputElement(); 1151 createOutputElement();
1152 outputElement.appendChild(document.createTextNode(result)); 1152 outputElement.appendChild(document.createTextNode(result));
1153 outputElement.appendChild(document.createElement("br")); 1153 outputElement.appendChild(document.createElement("br"));
1154 } 1154 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698