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

Unified Diff: test/inspector/debugger/framework-break.js

Issue 2651683005: [inspector] don't ignore uncaught exception if at least 1 frame isn't blackboxed (Closed)
Patch Set: addressed comments Created 3 years, 11 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/debug/debug.cc ('k') | test/inspector/debugger/framework-break-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/debugger/framework-break.js
diff --git a/test/inspector/debugger/framework-break.js b/test/inspector/debugger/framework-break.js
index 44ae680a68d5c73a4feda52a75c788d56b56a48b..5685e255b4bf384e6527327e4a223be12e686313 100644
--- a/test/inspector/debugger/framework-break.js
+++ b/test/inspector/debugger/framework-break.js
@@ -1,11 +1,11 @@
// 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.
+// Flags: --allow-natives-syntax
print('Checks that breaks in framework code correctly processed.');
-InspectorTest.addScript(
- `
+InspectorTest.addScript(`
function frameworkAssert() {
console.assert(false);
}
@@ -51,8 +51,21 @@ function throwFromJSONParse() {
}
}
-//# sourceURL=framework.js`,
- 7, 26);
+function throwInlinedUncaughtError() {
+ function inlinedWrapper() {
+ throwUserException();
+ }
+ %OptimizeFunctionOnNextCall(inlinedWrapper);
+ inlinedWrapper();
+}
+
+//# sourceURL=framework.js`, 8, 26);
+
+InspectorTest.addScript(`
+function throwUserException() {
+ throw new Error();
+}
+//# sourceURL=user.js`, 64, 26)
InspectorTest.setupScriptMap();
Protocol.Debugger.onPaused(message => {
@@ -98,17 +111,29 @@ InspectorTest.runTestSuite([
.then(() => InspectorTest.log('> all frames in framework:'))
.then(
() => Protocol.Runtime.evaluate(
- {expression: 'throwUncaughtError()//# sourceURL=framework.js'}))
+ {expression: 'setTimeout(\'throwUncaughtError()//# sourceURL=framework.js\', 0)//# sourceURL=framework.js'}))
+ .then(() => Protocol.Runtime.evaluate({ expression: "new Promise(resolve => setTimeout(resolve, 0))", awaitPromise: true}))
.then(() => InspectorTest.log('> mixed, top frame in framework:'))
.then(
() => Protocol.Runtime.evaluate(
- {expression: 'throwUncaughtError()//# sourceURL=user.js'}))
+ {expression: 'setTimeout(\'throwUncaughtError()//# sourceURL=user.js\', 0)'}))
+ .then(() => Protocol.Runtime.evaluate({ expression: "new Promise(resolve => setTimeout(resolve, 0))", awaitPromise: true}))
.then(() => Protocol.Debugger.setPauseOnExceptions({state: 'none'}))
.then(next);
},
+ function testUncaughtExceptionWithInlinedFrame(next) {
+ Protocol.Debugger.setPauseOnExceptions({state: 'all'})
+ .then(() => InspectorTest.log('> mixed top frame in framework:'))
+ .then(
+ () => Protocol.Runtime.evaluate(
+ {expression: 'setTimeout(\'throwInlinedUncaughtError()//# sourceURL=framework.js\', 0)//# sourceURL=framework.js'}))
+ .then(() => Protocol.Runtime.evaluate({ expression: "new Promise(resolve => setTimeout(resolve, 0))", awaitPromise: true}))
+ .then(next);
+ },
+
function testBreakpoint(next) {
- Protocol.Debugger.setBreakpointByUrl({lineNumber: 24, url: 'framework.js'})
+ Protocol.Debugger.setBreakpointByUrl({lineNumber: 25, url: 'framework.js'})
.then(() => InspectorTest.log('> all frames in framework:'))
.then(
() => Protocol.Runtime.evaluate(
« no previous file with comments | « src/debug/debug.cc ('k') | test/inspector/debugger/framework-break-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698