e6aed331383ae84bf42659735f9a2aff2e0de373
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / script-formatter-breakpoints-3.html
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="resources/unformatted2.js"></script>
6 <script>
7 var test = function()
8 {
9     WebInspector.breakpointManager._storage._breakpoints = {};
10     var panel = WebInspector.inspectorView.showPanel("sources");
11     var scriptFormatter = InspectorTest.scriptFormatter();
12     var sourceFrame;
13     var formattedSourceFrame;
14
15     InspectorTest.runDebuggerTestSuite([
16         function testBreakpointsSetInFormattedAndRemoveInOriginalSource(next)
17         {
18             InspectorTest.showScriptSource("unformatted2.js", didShowScriptSource);
19
20             function didShowScriptSource(frame)
21             {
22                 sourceFrame = frame;
23                 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
24                 scriptFormatter._toggleFormatScriptSource();
25             }
26                 
27             function uiSourceCodeScriptFormatted()
28             {
29                 formattedSourceFrame = panel.visibleView;
30                 InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
31                 InspectorTest.waitUntilPaused(pausedInF2);
32                 InspectorTest.evaluateInPageWithTimeout("f2()");
33             }
34
35             function pausedInF2(callFrames)
36             {
37                 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
38                 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
39                 InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
40                 // No need to remove breakpoint since formattedUISourceCode was removed.
41                 InspectorTest.resumeExecution(next);
42             }
43         }
44     ]);
45
46 }
47 </script>
48 </head>
49 <body onload="runTest()">
50 <p>Tests the script formatting is working fine with breakpoints.
51 </p>
52 </body>
53 </html>