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

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

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: rebased 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
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/await-promise.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/protocol-test.js
diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js
index 2259e15145ca6c8e351863e895b9068f80559f12..f88a66feec2f7acc5b77ca9338d6bb47602bf913 100644
--- a/test/inspector/protocol-test.js
+++ b/test/inspector/protocol-test.js
@@ -30,7 +30,31 @@ Protocol = new Proxy({}, {
}
});
-InspectorTest.log = print.bind(null);
+var utils = {};
+(function setupUtils() {
+ utils.load = load;
+ this.load = null;
+ utils.read = read;
+ this.read = 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 +62,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();
@@ -154,10 +179,7 @@ InspectorTest.logAsyncStackTrace = function(asyncStackTrace)
}
}
-InspectorTest.completeTest = function()
-{
- Protocol.Debugger.disable().then(() => quit());
-}
+InspectorTest.completeTest = () => Protocol.Debugger.disable().then(() => utils.quit());
InspectorTest.completeTestAfterPendingTimeouts = function()
{
@@ -169,9 +191,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()
{
@@ -181,7 +203,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);
}
@@ -245,7 +267,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") {
@@ -271,5 +293,5 @@ InspectorTest._dispatchMessage = function(messageObject)
}
InspectorTest.loadScript = function(fileName) {
- InspectorTest.addScript(read(fileName));
+ InspectorTest.addScript(utils.read(fileName));
}
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/await-promise.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698