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

Unified Diff: test/inspector/debugger/pause.js

Issue 2743163002: [inspector] use same schedulePauseOnNextStatement strategy for Debugger.pause (Closed)
Patch Set: better test 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 | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/pause-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/debugger/pause.js
diff --git a/test/inspector/debugger/pause.js b/test/inspector/debugger/pause.js
new file mode 100644
index 0000000000000000000000000000000000000000..33f76f9dcedfb2d6b19a7c474d866dcddceb258c
--- /dev/null
+++ b/test/inspector/debugger/pause.js
@@ -0,0 +1,89 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+InspectorTest.log('Checks Debugger.pause');
+
+InspectorTest.setupScriptMap();
+Protocol.Debugger.enable();
+InspectorTest.runAsyncTestSuite([
+ async function testPause() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'var a = 42;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ },
+
+ async function testSkipFrameworks() {
+ Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'});
+ Protocol.Runtime.evaluate({expression: 'var a = 239;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ },
+
+ async function testSkipOtherContext1() {
+ let contextGroupId = utils.createContextGroup();
+ Protocol.Debugger.enable({}, contextGroupId);
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'});
+ Protocol.Runtime.evaluate({expression: 'var a = 239;'}, contextGroupId);
+ Protocol.Runtime.evaluate({expression: 'var a = 1;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ await Protocol.Debugger.disable({}, contextGroupId);
+ },
+
+ async function testSkipOtherContext2() {
+ let contextGroupId = utils.createContextGroup();
+ Protocol.Debugger.enable({}, contextGroupId);
+ Protocol.Debugger.pause({}, contextGroupId);
+ Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'});
+ Protocol.Runtime.evaluate({expression: 'var a = 239;'}, contextGroupId);
+ Protocol.Runtime.evaluate({expression: 'var a = 1;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ await Protocol.Debugger.disable({}, contextGroupId);
+ },
+
+ async function testWithNativeBreakpoint() {
+ utils.schedulePauseOnNextStatement('', '');
+ await Protocol.Debugger.pause();
+ utils.cancelPauseOnNextStatement();
+ Protocol.Runtime.evaluate({expression: 'var a = 42;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+
+ await Protocol.Debugger.pause();
+ utils.schedulePauseOnNextStatement('', '');
+ utils.cancelPauseOnNextStatement();
+ Protocol.Runtime.evaluate({expression: 'var a = 42;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+
+ utils.schedulePauseOnNextStatement('', '');
+ utils.cancelPauseOnNextStatement();
+ await Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'var a = 42;'});
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ },
+
+ async function testDisableBreaksShouldCancelPause() {
+ await Protocol.Debugger.pause();
+ await Protocol.Debugger.setBreakpointsActive({active: false});
+ Protocol.Runtime.evaluate({expression: 'var a = 42;'})
+ .then(() => Protocol.Debugger.setBreakpointsActive({active: true}))
+ .then(() => Protocol.Runtime.evaluate({expression: 'debugger'}));
+ await waitPauseAndDumpLocation();
+ await Protocol.Debugger.resume();
+ }
+]);
+
+async function waitPauseAndDumpLocation() {
+ var message = await Protocol.Debugger.oncePaused();
+ InspectorTest.log('paused at:');
+ await InspectorTest.logSourceLocation(message.params.callFrames[0].location);
+ return message;
+}
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/pause-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698