Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-no-pause-on-antibreakpoint.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>
6
7 function throwAnException()
8 {
9     return unknown_var;
10 }
11
12 function handleClick()
13 {
14     throwAnException();
15 }
16
17 function handleClick2()
18 {
19     try {
20         throwAnException();
21     } catch (e) {
22     }
23     (3).changeValueTo(4);
24 }
25
26 var test = function()
27 {
28     var scriptFileName = "debugger-no-pause-on-antibreakpoint.html";
29
30     InspectorTest.startDebuggerTest(step1);
31     
32     function step1()
33     {
34         DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions);
35         InspectorTest.showScriptSource(scriptFileName, step2);
36     }
37
38     function step2()
39     {
40         InspectorTest.addResult("Script source was shown.");
41         InspectorTest.waitUntilPaused(step3);
42         InspectorTest.evaluateInPage("setTimeout(handleClick, 0)");
43     }
44
45     // Now set antibreakpoint and check that we still pause on other spots.
46     function step3(callFrames)
47     {
48         InspectorTest.captureStackTrace(callFrames);
49         
50         var exceptionLocation = callFrames[0].location();
51         DebuggerAgent.setBreakpointByUrl(exceptionLocation.lineNumber, undefined, scriptFileName,
52                                          exceptionLocation.columnNumber, undefined, true, undefined);
53
54         InspectorTest.resumeExecution(step4);
55     }
56
57     function step4()
58     {
59         InspectorTest.addResult("Antibreakpoint must be set by now.");
60         InspectorTest.evaluateInPage("setTimeout(handleClick2, 0)");
61         InspectorTest.waitUntilPaused(step5);
62     }
63     function step5(callFrames)
64     {
65         InspectorTest.captureStackTrace(callFrames);
66         if (callFrames.length != 1)
67             InspectorTest.addResult("Failure: a stack of single frame ('handleClick2') is expected");
68         
69         InspectorTest.resumeExecution(step6);
70     }
71     function step6()
72     {
73         InspectorTest.completeDebuggerTest();
74     }
75 }
76
77 </script>
78 </head>
79
80 <body onload="runTest()">
81 <p>
82 Tests that anti-breakpoint works.
83 </p>
84
85 </body>
86 </html>