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

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

Issue 2737603006: [inspector] added createContextGroup for tests (Closed)
Patch Set: a Created 3 years, 9 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/create-context.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 f4f6e7c5f793363c6d67e9ae5f8ca7d336074d61..5b625025fed575f2b644131112c1bcdf6749bf47 100644
--- a/test/inspector/protocol-test.js
+++ b/test/inspector/protocol-test.js
@@ -15,7 +15,7 @@ Protocol = new Proxy({}, {
const eventPattern = /^on(ce)?([A-Z][A-Za-z0-9]+)/;
var match = eventPattern.exec(methodName);
if (!match) {
- return (args) => InspectorTest._sendCommandPromise(`${agentName}.${methodName}`, args || {});
+ return (args, contextGroupId) => InspectorTest._sendCommandPromise(`${agentName}.${methodName}`, args || {}, contextGroupId);
} else {
var eventName = match[2];
eventName = eventName.charAt(0).toLowerCase() + eventName.slice(1);
@@ -52,6 +52,8 @@ var utils = {};
this.cancelPauseOnNextStatement = null;
utils.reconnect = reconnect;
this.reconnect = null;
+ utils.createContextGroup = createContextGroup;
+ this.createContextGroup = null;
})();
InspectorTest.log = utils.print.bind(null);
@@ -205,12 +207,12 @@ InspectorTest.startDumpingProtocolMessages = function()
InspectorTest._dumpInspectorProtocolMessages = true;
}
-InspectorTest.sendRawCommand = function(requestId, command, handler)
+InspectorTest.sendRawCommand = function(requestId, command, handler, contextGroupId)
{
if (InspectorTest._dumpInspectorProtocolMessages)
utils.print("frontend: " + command);
InspectorTest._dispatchTable.set(requestId, handler);
- sendMessageToBackend(command);
+ sendMessageToBackend(command, contextGroupId || 0);
}
InspectorTest.checkExpectation = function(fail, name, messageObject)
@@ -256,13 +258,13 @@ InspectorTest.runAsyncTestSuite = async function(testSuite) {
InspectorTest.completeTest();
}
-InspectorTest._sendCommandPromise = function(method, params)
+InspectorTest._sendCommandPromise = function(method, params, contextGroupId)
{
var requestId = ++InspectorTest._requestId;
var messageObject = { "id": requestId, "method": method, "params": params };
var fulfillCallback;
var promise = new Promise(fulfill => fulfillCallback = fulfill);
- InspectorTest.sendRawCommand(requestId, JSON.stringify(messageObject), fulfillCallback);
+ InspectorTest.sendRawCommand(requestId, JSON.stringify(messageObject), fulfillCallback, contextGroupId);
return promise;
}
« no previous file with comments | « test/inspector/inspector-test.cc ('k') | test/inspector/runtime/create-context.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698