Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-set-breakpoint-regex.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 testFunction()
8 {
9     foo();
10 }
11
12 function foo()
13 {
14 }
15
16 function test()
17 {
18     InspectorTest.runDebuggerTestSuite([
19         function testSetNoneOfURLAndRegex(next)
20         {
21             DebuggerAgent.setBreakpointByUrl.invoke({lineNumber: 1}, step2);
22
23             function step2(error)
24             {
25                 InspectorTest.addResult(error);
26                 next();
27             }
28         },
29
30         function testSetBothURLAndRegex(next)
31         {
32             var url = "debugger-set-breakpoint.js";
33             var urlRegex = "debugger-set-breakpoint.*";
34             DebuggerAgent.setBreakpointByUrl(1, url, urlRegex, step2);
35
36             function step2(error)
37             {
38                 InspectorTest.addResult(error);
39                 next();
40             }
41         },
42
43         function testSetByRegex(next)
44         {
45             DebuggerAgent.setBreakpointByUrl.invoke({urlRegex: "debugger-set-breakpoint.*", lineNumber:8}, step2);
46
47             function step2(result)
48             {
49                 InspectorTest.runTestFunctionAndWaitUntilPaused(step3);
50             }
51         
52             function step3(callFrames)
53             {
54                 InspectorTest.captureStackTrace(callFrames);
55                 next();
56             }
57         }
58     ]);
59 }
60
61 </script>
62 </head>
63
64 <body onload="runTest()">
65 <p>
66 Tests Debugger.setBreakpointByUrl with isRegex set to true.
67 </p>
68 </body>
69 </html>