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

Unified Diff: test/inspector/protocol-test.js

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: addressed comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/protocol-test.js
diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js
index d62c2e0c29fc940965c91e1efe14768b1e442a55..849cd8bdcf4b5c455b02693bd671bc9636c561cc 100644
--- a/test/inspector/protocol-test.js
+++ b/test/inspector/protocol-test.js
@@ -30,7 +30,29 @@ Protocol = new Proxy({}, {
}
});
-InspectorTest.log = print.bind(null);
+var utils = {};
+(function setupUtils() {
+ utils.load = load;
+ this.load = null;
+ utils.compileAndRunWithOrigin = compileAndRunWithOrigin;
+ this.compileAndRunWithOrigin = null;
+ utils.quit = quit;
+ this.quit = null;
+ utils.print = print;
+ this.print = null;
+ utils.setlocale = setlocale;
+ this.setlocale = null;
+ utils.setCurrentTimeMSForTest = setCurrentTimeMSForTest;
+ this.setCurrentTimeMSForTest = null;
+ utils.schedulePauseOnNextStatement = schedulePauseOnNextStatement;
+ this.schedulePauseOnNextStatement = null;
+ utils.cancelPauseOnNextStatement = cancelPauseOnNextStatement;
+ this.cancelPauseOnNextStatement = null;
+ utils.reconnect = reconnect;
+ this.reconnect = null;
+})();
+
+InspectorTest.log = utils.print.bind(null);
InspectorTest.logMessage = function(originalMessage)
{
@@ -38,7 +60,8 @@ InspectorTest.logMessage = function(originalMessage)
if (message.id)
message.id = "<messageId>";
- const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "timestamp", "executionContextId", "callFrameId", "breakpointId"]);
+ const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "timestamp",
+ "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFunctionId", "formatterObjectId" ]);
var objects = [ message ];
while (objects.length) {
var object = objects.shift();
@@ -128,10 +151,7 @@ InspectorTest.logAsyncStackTrace = function(asyncStackTrace)
}
}
-InspectorTest.completeTest = function()
-{
- Protocol.Debugger.disable().then(() => quit());
-}
+InspectorTest.completeTest = () => Protocol.Debugger.disable().then(() => utils.quit());
InspectorTest.completeTestAfterPendingTimeouts = function()
{
@@ -143,9 +163,9 @@ InspectorTest.waitPendingTasks = function()
return Protocol.Runtime.evaluate({ expression: "new Promise(r => setTimeout(r, 0))//# sourceURL=wait-pending-tasks.js", awaitPromise: true });
}
-InspectorTest.addScript = (string, lineOffset, columnOffset) => compileAndRunWithOrigin(string, "", lineOffset || 0, columnOffset || 0, false);
-InspectorTest.addScriptWithUrl = (string, url) => compileAndRunWithOrigin(string, url, 0, 0, false);
-InspectorTest.addModule = (string, url, lineOffset, columnOffset) => compileAndRunWithOrigin(string, url, lineOffset || 0, columnOffset || 0, true);
+InspectorTest.addScript = (string, lineOffset, columnOffset) => utils.compileAndRunWithOrigin(string, "", lineOffset || 0, columnOffset || 0, false);
+InspectorTest.addScriptWithUrl = (string, url) => utils.compileAndRunWithOrigin(string, url, 0, 0, false);
+InspectorTest.addModule = (string, url, lineOffset, columnOffset) => utils.compileAndRunWithOrigin(string, url, lineOffset || 0, columnOffset || 0, true);
InspectorTest.startDumpingProtocolMessages = function()
{
@@ -155,7 +175,7 @@ InspectorTest.startDumpingProtocolMessages = function()
InspectorTest.sendRawCommand = function(requestId, command, handler)
{
if (InspectorTest._dumpInspectorProtocolMessages)
- print("frontend: " + command);
+ utils.print("frontend: " + command);
InspectorTest._dispatchTable.set(requestId, handler);
sendMessageToBackend(command);
}
@@ -219,7 +239,7 @@ InspectorTest._waitForEventPromise = function(eventName)
InspectorTest._dispatchMessage = function(messageObject)
{
if (InspectorTest._dumpInspectorProtocolMessages)
- print("backend: " + JSON.stringify(messageObject));
+ utils.print("backend: " + JSON.stringify(messageObject));
try {
var messageId = messageObject["id"];
if (typeof messageId === "number") {

Powered by Google App Engine
This is Rietveld 408576698