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

Unified Diff: LayoutTests/inspector/sources/debugger/frameworks-steppings.html

Issue 309013005: DevTools: Event listener breakpoint should not stop if happened inside framework. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: one more test Created 6 years, 7 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: LayoutTests/inspector/sources/debugger/frameworks-steppings.html
diff --git a/LayoutTests/inspector/sources/debugger/frameworks-steppings.html b/LayoutTests/inspector/sources/debugger/frameworks-steppings.html
new file mode 100644
index 0000000000000000000000000000000000000000..497b39f1bb9b31fad2fcfaf5d8dab8ade0e0eb90
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/frameworks-steppings.html
@@ -0,0 +1,115 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/debugger-test.js"></script>
+<script src="resources/framework.js"></script>
+<script>
+
+function testFunction()
+{
+ debugger;
+ Framework.safeRun(function callback1() {
+ Framework.safeRun(Framework.empty, callback2);
+ });
+}
+
+function callback2()
+{
+ Framework.safeRun(Framework.empty, Framework.empty); // Should be skipped: all callbacks are inside frameworks.
+ Framework.safeRun(Framework.empty, Framework.throwFrameworkException, callback3); // Should be enough to step into callback3
+}
+
+function callback3()
+{
+ var func = Framework.bind(callback4, null, 1);
+ func = Framework.bind(func, null, 2);
+ func = Framework.bind(func, null, 3);
+ Framework.safeRun(func);
+}
+
+function callback4()
+{
+ Framework.safeRun(Framework.doSomeWork, function() {
+ return 0; // Should NOT step into this callback (otherwise too many StepIns)
+ });
+ try {
+ Framework.throwFrameworkException("message");
+ } catch (e) {
+ window.ex = e;
+ }
+}
+
+function test()
+{
+ var frameworkRegexString = "/framework\\.js$";
+ WebInspector.experimentsSettings.frameworksDebuggingSupport.enableForTest();
+ WebInspector.settings.skipStackFramesSwitch.set(true);
+ WebInspector.settings.skipStackFramesPattern.set(frameworkRegexString);
+
+ InspectorTest.setQuiet(true);
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
+ }
+
+ var actions = [
+ "Print", // debugger;
+ "StepInto", "StepInto", "Print", // callback1
+ "StepInto", "Print", // callback2
+ "StepInto", "Print", // callback2, skipped
+ "StepInto", "Print", // callback3
+ "StepInto", "StepInto", "StepInto", "StepInto", "Print", // callback4
+ "StepInto", "Print", // callback4, skipped
+ "StepInto", "Print", // callback4, inside catch
+ "StepOut", "Print", // return to callback3
+ "StepOver", "Print", // return to callback2
+ "StepInto", "Print", // return to callback1
+ ];
+
+ function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
+ {
+ var action = actions.shift();
+ if (action === "Print") {
+ InspectorTest.captureStackTrace(callFrames);
+ InspectorTest.addResult("");
+ while (action === "Print")
+ action = actions.shift();
+ }
+
+ if (!action) {
+ InspectorTest.completeDebuggerTest();
+ return;
+ }
+
+ InspectorTest.addResult("Executing " + action + "...");
+ switch (action) {
+ case "StepInto":
+ WebInspector.panels.sources._stepIntoButton.element.click();
+ break;
+ case "StepOver":
+ WebInspector.panels.sources._stepOverButton.element.click();
+ break;
+ case "StepOut":
+ WebInspector.panels.sources._stepOutButton.element.click();
+ break;
+ default:
+ InspectorTest.addResult("FAIL: Unknown action: " + action);
+ InspectorTest.completeDebuggerTest();
+ return;
+ }
+ InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<input type='button' onclick='testFunction()' value='Test'/>
+<p>
+Tests stepping into/over/out with framework black-boxing.
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698