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

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

Issue 2453673002: [DevTools] Scope common protocol infrastructure under Protocol namespace in a separate module. (Closed)
Patch Set: Created 4 years, 1 month 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
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.Target.prototype._dumpProtocolMessage = testRunner.logToStderr.bind (testRunner);
28 InspectorBackendClass.Options.dumpInspectorProtocolMessages = 1; 28 Protocol.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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 _output("[page] " + text); 1164 _output("[page] " + text);
1165 } 1165 }
1166 1166
1167 function _output(result) 1167 function _output(result)
1168 { 1168 {
1169 if (!outputElement) 1169 if (!outputElement)
1170 createOutputElement(); 1170 createOutputElement();
1171 outputElement.appendChild(document.createTextNode(result)); 1171 outputElement.appendChild(document.createTextNode(result));
1172 outputElement.appendChild(document.createElement("br")); 1172 outputElement.appendChild(document.createElement("br"));
1173 } 1173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698