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

Unified Diff: LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html

Issue 558333003: DevTools: Add a test on a crash fix in ScriptDebugServer::wrapCallFrames. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tweaked the test Created 6 years, 3 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 | « no previous file | LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
diff --git a/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html b/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..14a44bd21257fa7f6628006eb860818b6ffbfc0a
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
@@ -0,0 +1,72 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="../../../http/tests/inspector/console-test.js"></script>
+<script>
+var functions;
+
+function testFunction()
+{
+ console.clear();
+ // This used to be a racy crash. Test some sequence of functions.
+ functions = [f2, f1, f2, f1, f2, f1, f2, f1];
+ functions.push(function() {});
+ functions.shift()();
+}
+
+function f1() {
+ setTimeout(functions.shift(), 0);
+ document.body.appendChild("<throw_exception>");
+}
+
+function f2() {
+ setTimeout(functions.shift(), 0);
+ new Range().compareBoundaryPoints(1, 2);
+}
+
+var test = function()
+{
+ var expectedErrorsCount = 8;
+
+ InspectorTest.setQuiet(true);
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
+ }
+
+ function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
+ {
+ --expectedErrorsCount;
+ if (!expectedErrorsCount) {
+ InspectorTest.waitUntilNthMessageReceived(1, step2);
+ InspectorTest.resumeExecution();
+ } else {
+ InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
+ }
+ }
+
+ function step2()
+ {
+ InspectorTest.dumpConsoleMessages();
+ completeTest();
+ }
+
+ function completeTest()
+ {
+ DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
+ InspectorTest.completeDebuggerTest();
+ }
+}
+
+</script>
+</head>
+<body onload="window.testRunner ? runTest() : testFunction()">
+<p>
+Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698