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

Unified Diff: test/inspector/runtime/create-context.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed Created 3 years, 7 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/runtime/console-timestamp-expected.txt ('k') | test/inspector/runtime/es6-module.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/runtime/create-context.js
diff --git a/test/inspector/runtime/create-context.js b/test/inspector/runtime/create-context.js
index 8a7bd999da94d45d049bc640eb81eb6671539fd0..105bb592557b37972cba0a635f9b993845453f13 100644
--- a/test/inspector/runtime/create-context.js
+++ b/test/inspector/runtime/create-context.js
@@ -5,44 +5,46 @@
InspectorTest.log('Checks createContext().');
var executionContextIds = new Set();
-var contextGroup = InspectorTest.createContextGroup();
-var session = InspectorTest.createSession(contextGroup);
-setup(InspectorTest.session);
-setup(session);
+var contextGroup1 = new InspectorTest.ContextGroup();
+var session1 = contextGroup1.connect();
+setup(session1);
+var contextGroup2 = new InspectorTest.ContextGroup();
+var session2 = contextGroup2.connect();
+setup(session2);
-Protocol.Runtime.enable()
- .then(() => session.Protocol.Runtime.enable({}))
- .then(() => Protocol.Debugger.enable())
- .then(() => session.Protocol.Debugger.enable({}))
+session1.Protocol.Runtime.enable()
+ .then(() => session2.Protocol.Runtime.enable({}))
+ .then(() => session1.Protocol.Debugger.enable())
+ .then(() => session2.Protocol.Debugger.enable({}))
.then(InspectorTest.logMessage)
.then(() => {
- Protocol.Runtime.evaluate({ expression: 'debugger;' });
- session.Protocol.Runtime.evaluate({expression: 'setTimeout(x => x * 2, 0)'});
- Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
+ session1.Protocol.Runtime.evaluate({ expression: 'debugger;' });
+ session2.Protocol.Runtime.evaluate({expression: 'setTimeout(x => x * 2, 0)'});
+ session1.Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
})
- .then(() => InspectorTest.waitPendingTasks())
+ .then(() => InspectorTest.waitForPendingTasks())
.then(() => {
InspectorTest.log(`Reported script's execution id: ${executionContextIds.size}`);
executionContextIds.clear();
})
- .then(() => InspectorTest.session.reconnect())
- .then(() => session.reconnect())
+ .then(() => session1.reconnect())
+ .then(() => session2.reconnect())
.then(() => {
- Protocol.Runtime.evaluate({ expression: 'debugger;' })
- session.Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' });
- Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
+ session1.Protocol.Runtime.evaluate({ expression: 'debugger;' })
+ session2.Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 2, 0)' });
+ session1.Protocol.Runtime.evaluate({ expression: 'setTimeout(x => x * 3, 0)' });
})
- .then(() => InspectorTest.waitPendingTasks())
- .then(() => session.Protocol.Debugger.disable({}))
- .then(() => Protocol.Debugger.disable({}))
+ .then(() => InspectorTest.waitForPendingTasks())
+ .then(() => session2.Protocol.Debugger.disable({}))
+ .then(() => session1.Protocol.Debugger.disable({}))
.then(() => InspectorTest.log(`Reported script's execution id: ${executionContextIds.size}`))
.then(InspectorTest.completeTest);
function setup(session) {
session.Protocol.Runtime.onExecutionContextCreated(InspectorTest.logMessage);
- InspectorTest.setupScriptMap(session);
+ session.setupScriptMap();
session.Protocol.Debugger.onPaused((message) => {
- InspectorTest.logSourceLocation(message.params.callFrames[0].location, session);
+ session.logSourceLocation(message.params.callFrames[0].location);
session.Protocol.Debugger.stepOut();
});
session.Protocol.Debugger.onScriptParsed(message => executionContextIds.add(message.params.executionContextId));
« no previous file with comments | « test/inspector/runtime/console-timestamp-expected.txt ('k') | test/inspector/runtime/es6-module.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698