86e0c22c1cc68b117d1b3d93cfe5c18ad48a7953
[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/unformatted3.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
13     InspectorTest.runDebuggerTestSuite([
14         function testBreakpointsSetInFormattedAndRemoveInOriginalSource(next)
15         {
16             InspectorTest.showScriptSource("unformatted3.js", didShowScriptSource);
17
18             function didShowScriptSource(frame)
19             {
20                 InspectorTest.addSniffer(WebInspector.ScriptFormatterEditorAction.prototype, "_updateButton", uiSourceCodeScriptFormatted);
21                 scriptFormatter._toggleFormatScriptSource();
22             }
23                 
24             function uiSourceCodeScriptFormatted()
25             {
26                 var formattedSourceFrame = panel.visibleView;
27                 InspectorTest.setBreakpoint(formattedSourceFrame, 3, "", true);
28                 InspectorTest.waitUntilPaused(pausedInF2);
29                 InspectorTest.evaluateInPageWithTimeout("f2()");
30             }
31
32             function pausedInF2(callFrames)
33             {
34                 InspectorTest.dumpBreakpointSidebarPane("while paused in pretty printed");
35                 scriptFormatter._discardFormattedUISourceCodeScript(panel.visibleView.uiSourceCode());
36                 InspectorTest.dumpBreakpointSidebarPane("while paused in raw");
37                 // No need to remove breakpoint since formattedUISourceCode was removed.
38                 InspectorTest.resumeExecution(next);
39             }
40         }
41     ]);
42
43 }
44 </script>
45 </head>
46 <body onload="runTest()">
47 <p>Tests the script formatting is working fine with breakpoints.
48 </p>
49 </body>
50 </html>