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

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

Issue 2743163002: [inspector] use same schedulePauseOnNextStatement strategy for Debugger.pause (Closed)
Patch Set: 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
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..b96b767bb2a96a08f47444eb87febb6f3233d5a2
--- /dev/null
+++ b/test/inspector/debugger/pause.js
@@ -0,0 +1,77 @@
+// 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();
+ },
+
+ 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();
+ },
+
+ 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 waitPauseAndDumpLocation() {
+ var message = await Protocol.Debugger.oncePaused();
+ InspectorTest.log('paused at:');
+ await InspectorTest.logSourceLocation(message.params.callFrames[0].location);
+ return message;
+}

Powered by Google App Engine
This is Rietveld 408576698