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

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

Issue 2600323002: DevTools: extract protocol module (Closed)
Patch Set: move inspector backend commands.js Created 3 years, 11 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/LayoutTests/http/tests/inspector/protocol-test.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 }
11 11
12 window._originalConsoleLog = console.log.bind(console); 12 window._originalConsoleLog = console.log.bind(console);
13 13
14 console.log = consoleOutputHook.bind(InspectorTest, "log"); 14 console.log = consoleOutputHook.bind(InspectorTest, "log");
15 console.error = consoleOutputHook.bind(InspectorTest, "error"); 15 console.error = consoleOutputHook.bind(InspectorTest, "error");
16 console.info = consoleOutputHook.bind(InspectorTest, "info"); 16 console.info = consoleOutputHook.bind(InspectorTest, "info");
17 console.assert = function(condition, object) 17 console.assert = function(condition, object)
18 { 18 {
19 if (condition) 19 if (condition)
20 return; 20 return;
21 var message = "Assertion failed: " + (typeof object !== "undefined" ? object : ""); 21 var message = "Assertion failed: " + (typeof object !== "undefined" ? object : "");
22 InspectorTest.addResult(new Error(message).stack); 22 InspectorTest.addResult(new Error(message).stack);
23 } 23 }
24 24
25 InspectorTest.startDumpingProtocolMessages = function() 25 InspectorTest.startDumpingProtocolMessages = function()
26 { 26 {
27 InspectorBackendClass.Connection.prototype._dumpProtocolMessage = testRunner .logToStderr.bind(testRunner); 27 Protocol.InspectorBackend.Connection.prototype._dumpProtocolMessage = testRu nner.logToStderr.bind(testRunner);
28 InspectorBackendClass.Options.dumpInspectorProtocolMessages = 1; 28 Protocol.InspectorBackend.Options.dumpInspectorProtocolMessages = 1;
29 } 29 }
30 30
31 InspectorTest.completeTest = function() 31 InspectorTest.completeTest = function()
32 { 32 {
33 InspectorTest.RuntimeAgent.evaluate("completeTest(\"" + escape(JSON.stringif y(results)) + "\")", "test"); 33 InspectorTest.RuntimeAgent.evaluate("completeTest(\"" + escape(JSON.stringif y(results)) + "\")", "test");
34 } 34 }
35 35
36 InspectorTest.flushResults = function() 36 InspectorTest.flushResults = function()
37 { 37 {
38 InspectorTest.RuntimeAgent.evaluate("flushResults(\"" + escape(JSON.stringif y(results)) + "\")", "test"); 38 InspectorTest.RuntimeAgent.evaluate("flushResults(\"" + escape(JSON.stringif y(results)) + "\")", "test");
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 _output("[page] " + text); 1225 _output("[page] " + text);
1226 } 1226 }
1227 1227
1228 function _output(result) 1228 function _output(result)
1229 { 1229 {
1230 if (!outputElement) 1230 if (!outputElement)
1231 createOutputElement(); 1231 createOutputElement();
1232 outputElement.appendChild(document.createTextNode(result)); 1232 outputElement.appendChild(document.createTextNode(result));
1233 outputElement.appendChild(document.createElement("br")); 1233 outputElement.appendChild(document.createElement("br"));
1234 } 1234 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/protocol-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698