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

Unified Diff: LayoutTests/inspector/sources/debugger/script-formatter-breakpoints.html

Issue 188443004: DevTools: Split slow script-formatter-breakpoints.html test into two tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: LayoutTests/inspector/sources/debugger/script-formatter-breakpoints.html
diff --git a/LayoutTests/inspector/sources/debugger/script-formatter-breakpoints.html b/LayoutTests/inspector/sources/debugger/script-formatter-breakpoints.html
deleted file mode 100644
index e4127b62720e05e0115d277025a60fa526948052..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/sources/debugger/script-formatter-breakpoints.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script src="resources/unformatted.js"></script>
-
-<script>
-
-function f1()
-{
- var a=0;var b=1;var c=3;var d=4;var e=5;
- var f=0;
- return 0;
-}
-
-var test = function()
-{
- WebInspector.breakpointManager._storage._breakpoints = {};
- var panel = WebInspector.showPanel("sources");
- var scriptFormatter = InspectorTest.scriptFormatter();
- var sourceFrame;
- var formattedSourceFrame;
-
- InspectorTest.runDebuggerTestSuite([
- function testBreakpointsInOriginalAndFormattedSource(next)
- {
- InspectorTest.showScriptSource("script-formatter-breakpoints.html", didShowScriptSource);
-
- function didShowScriptSource(frame)
- {
- sourceFrame = frame;
- InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
- InspectorTest.waitUntilPaused(pausedInF1);
- InspectorTest.evaluateInPageWithTimeout("f1()");
- }
-
- function pausedInF1(callFrames)
- {
- InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
- InspectorTest.resumeExecution(resumed);
- }
-
- function resumed()
- {
- InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
- scriptFormatter._toggleFormatScriptSource();
- }
-
- function uiSourceCodeScriptFormatted()
- {
- // There should be a breakpoint in f1 although script is pretty-printed.
- InspectorTest.waitUntilPaused(pausedInF1Again);
- InspectorTest.evaluateInPageWithTimeout("f1()");
- }
-
- function pausedInF1Again(callFrames)
- {
- InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
- scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
- InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
- InspectorTest.removeBreakpoint(sourceFrame, 11);
- InspectorTest.resumeExecution(next);
- }
- },
-
- function testBreakpointSetInOriginalAndRemovedInFormatted(next)
- {
- InspectorTest.showScriptSource("script-formatter-breakpoints.html", didShowScriptSource);
-
- function didShowScriptSource(frame)
- {
- sourceFrame = frame;
- InspectorTest.addResult("Adding breakpoint.");
- InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoint.prototype, "_addResolvedLocation", breakpointResolved);
- InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
- }
-
- function breakpointResolved()
- {
- InspectorTest.addResult("Formatting.");
- InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
- scriptFormatter._toggleFormatScriptSource();
- }
-
- function uiSourceCodeScriptFormatted()
- {
- InspectorTest.addResult("Removing breakpoint.");
- formattedSourceFrame = panel.visibleView;
- InspectorTest.removeBreakpoint(formattedSourceFrame, 16);
- InspectorTest.addResult("Unformatting.");
- scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
- var breakpoints = WebInspector.breakpointManager._storage._setting.get();
- InspectorTest.assertEquals(breakpoints.length, 0, "There should not be any breakpoints in the storage.");
- next();
- }
- },
-
- function testBreakpointsSetAndRemoveInFormattedSource(next)
- {
- InspectorTest.showScriptSource("unformatted.js", didShowScriptSource);
-
- function didShowScriptSource(frame)
- {
- sourceFrame = frame;
- InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
- scriptFormatter._toggleFormatScriptSource();
- }
-
- function uiSourceCodeScriptFormatted()
- {
- formattedSourceFrame = panel.visibleView;
- InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
- InspectorTest.waitUntilPaused(pausedInF2);
- InspectorTest.evaluateInPageWithTimeout("f2()");
- }
-
- function pausedInF2(callFrames)
- {
- InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
- InspectorTest.removeBreakpoint(formattedSourceFrame, 3);
- scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
- InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
- InspectorTest.resumeExecution(next);
- }
- },
-
- function testBreakpointsSetInFormattedAndRemoveInOriginalSource(next)
- {
- InspectorTest.showScriptSource("unformatted.js", didShowScriptSource);
-
- function didShowScriptSource(frame)
- {
- sourceFrame = frame;
- InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
- scriptFormatter._toggleFormatScriptSource();
- }
-
- function uiSourceCodeScriptFormatted()
- {
- formattedSourceFrame = panel.visibleView;
- InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
- InspectorTest.waitUntilPaused(pausedInF2);
- InspectorTest.evaluateInPageWithTimeout("f2()");
- }
-
- function pausedInF2(callFrames)
- {
- InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
- scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
- InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
- // No need to remove breakpoint since formattedUISourceCode was removed.
- InspectorTest.resumeExecution(next);
- }
- }
- ]);
-
-}
-
-</script>
-
-</head>
-
-<body onload="runTest()">
-<p>Tests the script formatting is working fine with breakpoints.
-</p>
-
-</body>
-</html>
« no previous file with comments | « LayoutTests/StaleTestExpectations ('k') | LayoutTests/inspector/sources/debugger/script-formatter-breakpoints-1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698