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

Side by Side Diff: LayoutTests/inspector/sources/debugger/multi-target-breakpoint-manager.html

Issue 332173002: DevTools: Add test multi-target-breakpoint-manager.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="breakpoint-manager.js"></script>
5
6 <script>
7
8 function test()
9 {
10 InspectorTest.dumpTargetIds = true;
11 InspectorTest.setupLiveLocationSniffers();
12
13
14 InspectorTest.runTestSuite([
15
16 function testResolvedBreakpointInBothTarget(next)
17 {
18 var targetManager = new WebInspector.TargetManager();
19 var target1 = InspectorTest.createMockTarget(targetManager, 1);
20 targetManager._targets.push(target1);
21 var breakpointManager = InspectorTest.createBreakpointManager(target Manager);
22 var uiSourceCode = InspectorTest.addUISourceCode(target1, breakpoint Manager, "a.js");
23 var target2;
24 InspectorTest.setBreakpoint(breakpointManager, uiSourceCode, 30, 0, "", true, step1);
25
26 function step1()
27 {
28 target1.debuggerModel._breakpointResolved("a.js:30", new WebInsp ector.DebuggerModel.Location(target1, "a.js", 131, 5));
29 InspectorTest.dumpBreakpointLocations(breakpointManager);
30 InspectorTest.addResult(" Second target intruded!");
vsevik 2014/06/16 11:12:35 added.
sergeyv 2014/06/16 11:21:45 Done.
31 target2 = InspectorTest.createMockTarget(targetManager, 2);
32 new InspectorTest.DebuggerModelMock(target2, target2.defaultMapp ing);
33 targetManager.addTarget(target2);
34 target2.debuggerModel._addScript("a.js", "a.js");
35 uiSourceCode.setSourceMappingForTarget(target2, target2.defaultM apping);
36 window.setBreakpointCallback = step2;
37 }
38
39 function step2()
40 {
41 target2.debuggerModel._breakpointResolved("a.js:30", new WebInsp ector.DebuggerModel.Location(target2, "a.js", 30, 5));
42 InspectorTest.dumpBreakpointLocations(breakpointManager);
43 InspectorTest.addResult(" First target escaped!")
vsevik 2014/06/16 11:12:35 removed.
sergeyv 2014/06/16 11:21:45 Done.
44 targetManager.removeTarget(target1);
vsevik 2014/06/16 11:12:35 Let's also remove the second one then.
sergeyv 2014/06/16 11:21:44 Done.
45 InspectorTest.dumpBreakpointLocations(breakpointManager);
46 InspectorTest.finishBreakpointTest(breakpointManager, next)
47 }
48
49 },
50
51 function testResolvedBreakpointInOneTarget(next)
52 {
53 var targetManager = new WebInspector.TargetManager();
54 var target1 = InspectorTest.createMockTarget(targetManager, 1);
55 var target2 = InspectorTest.createMockTarget(targetManager, 2);
56
57 targetManager._targets.push(target1);
58 targetManager._targets.push(target2);
59 var breakpointManager = InspectorTest.createBreakpointManager(target Manager);
60 var uiSourceCode = InspectorTest.addUISourceCode(target1, breakpoint Manager, "a.js");
61 InspectorTest.setBreakpoint(breakpointManager, uiSourceCode, 30, 0, "", true, step1);
62
63 function step1()
64 {
65 window.setBreakpointCallback = step2;
66 }
67
68 function step2()
69 {
70 InspectorTest.addResult(" First target escaped!")
71 targetManager.removeTarget(target1);
72 InspectorTest.dumpBreakpointLocations(breakpointManager);
73 InspectorTest.finishBreakpointTest(breakpointManager, next);
74 }
75
76 },
77
78 ]);
79 };
80
vsevik 2014/06/16 11:12:35 Can we also test debuggerModel disabling?
81 </script>
82
83 </head>
84
85 <body onload="runTest()">
86 <p>Tests BreakpointManager class.</p>
87
88 </body>
89 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698