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

Side by Side Diff: test/inspector/protocol-test.js

Issue 2784713002: [inspector] console get all information from inspector when needed (Closed)
Patch Set: fixed last test Created 3 years, 8 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 | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/command-line-api.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 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 InspectorTest = {}; 5 InspectorTest = {};
6 InspectorTest._dispatchTable = new Map(); 6 InspectorTest._dispatchTable = new Map();
7 InspectorTest._requestId = 0; 7 InspectorTest._requestId = 0;
8 InspectorTest._dumpInspectorProtocolMessages = false; 8 InspectorTest._dumpInspectorProtocolMessages = false;
9 InspectorTest._eventHandler = {}; 9 InspectorTest._eventHandler = {};
10 InspectorTest._commandsForLogging = new Set(); 10 InspectorTest._commandsForLogging = new Set();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 utils.compileAndRunWithOrigin = compileAndRunWithOrigin; 42 utils.compileAndRunWithOrigin = compileAndRunWithOrigin;
43 this.compileAndRunWithOrigin = null; 43 this.compileAndRunWithOrigin = null;
44 utils.quit = quit; 44 utils.quit = quit;
45 this.quit = null; 45 this.quit = null;
46 utils.print = print; 46 utils.print = print;
47 this.print = null; 47 this.print = null;
48 utils.setlocale = setlocale; 48 utils.setlocale = setlocale;
49 this.setlocale = null; 49 this.setlocale = null;
50 utils.setCurrentTimeMSForTest = setCurrentTimeMSForTest; 50 utils.setCurrentTimeMSForTest = setCurrentTimeMSForTest;
51 this.setCurrentTimeMSForTest = null; 51 this.setCurrentTimeMSForTest = null;
52 utils.setMemoryInfoForTest = setMemoryInfoForTest;
53 this.setMemoryInfoForTest = null;
52 utils.schedulePauseOnNextStatement = schedulePauseOnNextStatement; 54 utils.schedulePauseOnNextStatement = schedulePauseOnNextStatement;
53 this.schedulePauseOnNextStatement = null; 55 this.schedulePauseOnNextStatement = null;
54 utils.cancelPauseOnNextStatement = cancelPauseOnNextStatement; 56 utils.cancelPauseOnNextStatement = cancelPauseOnNextStatement;
55 this.cancelPauseOnNextStatement = null; 57 this.cancelPauseOnNextStatement = null;
56 utils.reconnect = reconnect; 58 utils.reconnect = reconnect;
57 this.reconnect = null; 59 this.reconnect = null;
58 utils.createContextGroup = createContextGroup; 60 utils.createContextGroup = createContextGroup;
59 this.createContextGroup = null; 61 this.createContextGroup = null;
60 })(); 62 })();
61 63
62 InspectorTest.log = utils.print.bind(null); 64 InspectorTest.log = utils.print.bind(null);
63 65
64 InspectorTest.logMessage = function(originalMessage) 66 InspectorTest.logMessage = function(originalMessage)
65 { 67 {
66 var message = JSON.parse(JSON.stringify(originalMessage)); 68 var message = JSON.parse(JSON.stringify(originalMessage));
67 if (message.id) 69 if (message.id)
68 message.id = "<messageId>"; 70 message.id = "<messageId>";
69 71
70 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times tamp", 72 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times tamp",
71 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti onId", "formatterObjectId" ]); 73 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti onId", "formatterObjectId" ]);
72 var objects = [ message ]; 74 var objects = [ message ];
73 while (objects.length) { 75 while (objects.length) {
74 var object = objects.shift(); 76 var object = objects.shift();
75 for (var key in object) { 77 for (var key in object) {
76 if (nonStableFields.has(key)) 78 if (nonStableFields.has(key))
77 object[key] = `<${key}>`; 79 object[key] = `<${key}>`;
80 else if (typeof object[key] === "string" && object[key].match(/\d+:\d+:\d+ :debug/))
81 object[key] = object[key].replace(/\d+/, '<scriptId>');
78 else if (typeof object[key] === "object") 82 else if (typeof object[key] === "object")
79 objects.push(object[key]); 83 objects.push(object[key]);
80 } 84 }
81 } 85 }
82 86
83 InspectorTest.logObject(message); 87 InspectorTest.logObject(message);
84 return originalMessage; 88 return originalMessage;
85 } 89 }
86 90
87 InspectorTest.logObject = function(object, title) 91 InspectorTest.logObject = function(object, title)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to get more details.'); 349 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to get more details.');
346 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to get unminified injected-script-source.js.'); 350 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to get unminified injected-script-source.js.');
347 InspectorTest.setupScriptMap(); 351 InspectorTest.setupScriptMap();
348 Protocol.Debugger.enable(); 352 Protocol.Debugger.enable();
349 Protocol.Debugger.onPaused(message => { 353 Protocol.Debugger.onPaused(message => {
350 let callFrames = message.params.callFrames; 354 let callFrames = message.params.callFrames;
351 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location)); 355 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location));
352 }) 356 })
353 } 357 }
354 } 358 }
OLDNEW
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/command-line-api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698