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

Unified Diff: test/inspector/debugger/inspector-break-api.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/inspector-break-api.js
diff --git a/test/inspector/debugger/inspector-break-api.js b/test/inspector/debugger/inspector-break-api.js
index 178da5b0279e9834f319bbd7807adddbe7f23b24..dc39924200992a44960bc67102647f4eee3924b1 100644
--- a/test/inspector/debugger/inspector-break-api.js
+++ b/test/inspector/debugger/inspector-break-api.js
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-InspectorTest.log("Checks breakProgram,(schedule|cancel)PauseOnNextStatement test API");
+let {session, contextGroup, Protocol} = InspectorTest.start("Checks breakProgram,(schedule|cancel)PauseOnNextStatement test API");
-InspectorTest.addScript(`
+contextGroup.addScript(`
function callBreakProgram() {
inspector.breakProgram('reason', JSON.stringify({a: 42}));
}
@@ -13,10 +13,10 @@ function foo() {
return 42;
}`, 7, 26);
-InspectorTest.setupScriptMap();
+session.setupScriptMap();
Protocol.Debugger.onPaused(message => {
InspectorTest.log('Stack:');
- InspectorTest.logCallFrames(message.params.callFrames);
+ session.logCallFrames(message.params.callFrames);
delete message.params.callFrames;
InspectorTest.log('Other data:');
InspectorTest.logMessage(message);
@@ -33,17 +33,17 @@ InspectorTest.runTestSuite([
},
function testSchedulePauseOnNextStatement(next) {
- InspectorTest.contextGroup.schedulePauseOnNextStatement('reason', JSON.stringify({a: 42}));
+ contextGroup.schedulePauseOnNextStatement('reason', JSON.stringify({a: 42}));
Protocol.Runtime.evaluate({ expression: 'foo()//# sourceURL=expr1.js'})
.then(() => Protocol.Runtime.evaluate({
expression: 'foo()//# sourceURL=expr2.js'}))
- .then(() => InspectorTest.contextGroup.cancelPauseOnNextStatement())
+ .then(() => contextGroup.cancelPauseOnNextStatement())
.then(next);
},
function testCancelPauseOnNextStatement(next) {
- InspectorTest.contextGroup.schedulePauseOnNextStatement('reason', JSON.stringify({a: 42}));
- InspectorTest.contextGroup.cancelPauseOnNextStatement();
+ contextGroup.schedulePauseOnNextStatement('reason', JSON.stringify({a: 42}));
+ contextGroup.cancelPauseOnNextStatement();
Protocol.Runtime.evaluate({ expression: 'foo()'})
.then(next);
}

Powered by Google App Engine
This is Rietveld 408576698