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

Side by Side Diff: test/inspector/debugger/break-on-exception.js

Issue 2396193002: [inspector] move changeBreakpointState from debugger-script to native (Closed)
Patch Set: rebased Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/inspector/debugger/break-on-exception-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 print("Check that inspector correctly change break on exception state.");
6
7 InspectorTest.addScript(`
8 function scheduleUncaughtException()
9 {
10 setTimeout(throwUncaughtException, 0);
11 }
12 function throwUncaughtException()
13 {
14 throw new Error();
15 }
16 function throwCaughtException()
17 {
18 throw new Error();
19 }`);
20
21 Protocol.Debugger.onPaused(message => {
22 InspectorTest.log("paused in " + message.params.callFrames[0].functionName);
23 Protocol.Debugger.resume();
24 });
25
26 Protocol.Runtime.enable();
27
28 InspectorTest.runTestSuite([
29 function noBreakOnExceptionAfterEnabled(next)
30 {
31 Protocol.Debugger.enable();
32 Protocol.Debugger.setPauseOnExceptions({ state: "all" });
33 Protocol.Debugger.disable();
34 Protocol.Debugger.enable();
35 Protocol.Runtime.evaluate({ expression: "scheduleUncaughtException()" })
36 .then(() => Protocol.Runtime.evaluate({ expression: "throwCaughtException( )" }))
37 .then(() => Protocol.Debugger.disable())
38 .then(next);
39 },
40
41 function breakOnUncaughtException(next)
42 {
43 Protocol.Debugger.enable();
44 Protocol.Debugger.setPauseOnExceptions({ state: "uncaught" });
45 Protocol.Runtime.evaluate({ expression: "scheduleUncaughtException()" })
46 .then(() => Protocol.Runtime.onceExceptionThrown())
47 .then(() => Protocol.Runtime.evaluate({ expression: "throwCaughtException( )" }))
48 .then(() => Protocol.Debugger.disable())
49 .then(next);
50 },
51
52 function breakOnCaughtException(next)
53 {
54 Protocol.Debugger.enable();
55 Protocol.Debugger.setPauseOnExceptions({ state: "all" });
56 Protocol.Runtime.evaluate({ expression: "scheduleUncaughtException()" })
57 .then(() => Protocol.Runtime.onceExceptionThrown())
58 .then(() => Protocol.Runtime.evaluate({ expression: "throwCaughtException( )" }))
59 .then(() => Protocol.Debugger.disable())
60 .then(next);
61 },
62
63 function noBreakInEvaluateInSilentMode(next)
64 {
65 Protocol.Debugger.enable();
66 Protocol.Debugger.setPauseOnExceptions({ state: "all" })
67 .then(() => Protocol.Runtime.evaluate({ expression: "throwCaughtException( )", silent: true }))
68 .then(() => Protocol.Debugger.disable())
69 .then(next);
70 }
71 ]);
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/inspector/debugger/break-on-exception-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698