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

Unified Diff: test/inspector/debugger/step-over-another-context-group.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
Index: test/inspector/debugger/step-over-another-context-group.js
diff --git a/test/inspector/debugger/step-over-another-context-group.js b/test/inspector/debugger/step-over-another-context-group.js
index d262b4a758b2c08cded9b2b1ccc50b9589459779..758ff84697b35154e4b491d5a1e3f7d6ed199638 100644
--- a/test/inspector/debugger/step-over-another-context-group.js
+++ b/test/inspector/debugger/step-over-another-context-group.js
@@ -4,29 +4,33 @@
InspectorTest.log('Checks stepping with more then one context group.');
+var contextGroup1 = new InspectorTest.ContextGroup();
+var session1 = contextGroup1.connect();
+session1.setupScriptMap();
+
+let contextGroup2 = new InspectorTest.ContextGroup();
+let session2 = contextGroup2.connect();
+session2.setupScriptMap();
+
(async function test() {
- InspectorTest.setupScriptMap();
- await Protocol.Debugger.enable();
- let contextGroup = InspectorTest.createContextGroup();
- let session = InspectorTest.createSession(contextGroup);
- InspectorTest.setupScriptMap(session);
- await session.Protocol.Debugger.enable({});
- Protocol.Runtime.evaluate({expression: 'debugger'});
- session.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { debugger }, 0)'});
- Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
- await waitPauseAndDumpLocation(InspectorTest.session);
- Protocol.Debugger.stepOver();
- await Protocol.Debugger.oncePaused();
- Protocol.Debugger.stepOver();
- await waitPauseAndDumpLocation(InspectorTest.session);
- await session.Protocol.Debugger.disable({});
- await Protocol.Debugger.disable();
+ await session1.Protocol.Debugger.enable();
+ await session2.Protocol.Debugger.enable({});
+ session1.Protocol.Runtime.evaluate({expression: 'debugger'});
+ session2.Protocol.Runtime.evaluate({expression: 'setTimeout(() => { debugger }, 0)'});
+ session1.Protocol.Runtime.evaluate({expression: 'setTimeout(() => 42, 0)'});
+ await waitPauseAndDumpLocation(session1);
+ session1.Protocol.Debugger.stepOver();
+ await session1.Protocol.Debugger.oncePaused();
+ session1.Protocol.Debugger.stepOver();
+ await waitPauseAndDumpLocation(session1);
+ await session2.Protocol.Debugger.disable({});
+ await session1.Protocol.Debugger.disable();
InspectorTest.completeTest();
})();
async function waitPauseAndDumpLocation(session) {
var message = await session.Protocol.Debugger.oncePaused();
InspectorTest.log('paused at:');
- await InspectorTest.logSourceLocation(message.params.callFrames[0].location, session);
+ await session.logSourceLocation(message.params.callFrames[0].location);
return message;
}
« no previous file with comments | « test/inspector/debugger/step-out-async-await.js ('k') | test/inspector/debugger/step-over-caught-exception.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698