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

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: Address vsevik's comments 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 added");
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 removed")
44 targetManager.removeTarget(target1);
45 InspectorTest.dumpBreakpointLocations(breakpointManager);
46 InspectorTest.addResult(" Second target removed")
47 targetManager.removeTarget(target2);
48 InspectorTest.finishBreakpointTest(breakpointManager, next)
49 }
50
51 },
52
53 function testResolvedBreakpointInOneTarget(next)
54 {
55 var targetManager = new WebInspector.TargetManager();
56 var target1 = InspectorTest.createMockTarget(targetManager, 1);
57 var target2 = InspectorTest.createMockTarget(targetManager, 2);
58
59 targetManager._targets.push(target1);
60 targetManager._targets.push(target2);
61 var breakpointManager = InspectorTest.createBreakpointManager(target Manager);
62 var uiSourceCode = InspectorTest.addUISourceCode(target1, breakpoint Manager, "a.js");
63 InspectorTest.setBreakpoint(breakpointManager, uiSourceCode, 30, 0, "", true, step1);
64
65 function step1()
66 {
67 window.setBreakpointCallback = step2;
68 }
69
70 function step2()
71 {
72 InspectorTest.addResult(" First target removed!")
73 targetManager.removeTarget(target1);
74 InspectorTest.dumpBreakpointLocations(breakpointManager);
75 InspectorTest.finishBreakpointTest(breakpointManager, next);
76 }
77 },
78
79 ]);
80 };
81
82 </script>
83
84 </head>
85
86 <body onload="runTest()">
87 <p>Tests BreakpointManager class.</p>
88
89 </body>
90 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698