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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/sources/debugger/multi-target-breakpoint-manager.html
diff --git a/LayoutTests/inspector/sources/debugger/multi-target-breakpoint-manager.html b/LayoutTests/inspector/sources/debugger/multi-target-breakpoint-manager.html
new file mode 100644
index 0000000000000000000000000000000000000000..a853f41b38c552a3908816f33bb3f9365ededb84
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/multi-target-breakpoint-manager.html
@@ -0,0 +1,89 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="breakpoint-manager.js"></script>
+
+<script>
+
+function test()
+{
+ InspectorTest.dumpTargetIds = true;
+ InspectorTest.setupLiveLocationSniffers();
+
+
+ InspectorTest.runTestSuite([
+
+ function testResolvedBreakpointInBothTarget(next)
+ {
+ var targetManager = new WebInspector.TargetManager();
+ var target1 = InspectorTest.createMockTarget(targetManager, 1);
+ targetManager._targets.push(target1);
+ var breakpointManager = InspectorTest.createBreakpointManager(targetManager);
+ var uiSourceCode = InspectorTest.addUISourceCode(target1, breakpointManager, "a.js");
+ var target2;
+ InspectorTest.setBreakpoint(breakpointManager, uiSourceCode, 30, 0, "", true, step1);
+
+ function step1()
+ {
+ target1.debuggerModel._breakpointResolved("a.js:30", new WebInspector.DebuggerModel.Location(target1, "a.js", 131, 5));
+ InspectorTest.dumpBreakpointLocations(breakpointManager);
+ InspectorTest.addResult(" Second target intruded!");
vsevik 2014/06/16 11:12:35 added.
sergeyv 2014/06/16 11:21:45 Done.
+ target2 = InspectorTest.createMockTarget(targetManager, 2);
+ new InspectorTest.DebuggerModelMock(target2, target2.defaultMapping);
+ targetManager.addTarget(target2);
+ target2.debuggerModel._addScript("a.js", "a.js");
+ uiSourceCode.setSourceMappingForTarget(target2, target2.defaultMapping);
+ window.setBreakpointCallback = step2;
+ }
+
+ function step2()
+ {
+ target2.debuggerModel._breakpointResolved("a.js:30", new WebInspector.DebuggerModel.Location(target2, "a.js", 30, 5));
+ InspectorTest.dumpBreakpointLocations(breakpointManager);
+ InspectorTest.addResult(" First target escaped!")
vsevik 2014/06/16 11:12:35 removed.
sergeyv 2014/06/16 11:21:45 Done.
+ 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.
+ InspectorTest.dumpBreakpointLocations(breakpointManager);
+ InspectorTest.finishBreakpointTest(breakpointManager, next)
+ }
+
+ },
+
+ function testResolvedBreakpointInOneTarget(next)
+ {
+ var targetManager = new WebInspector.TargetManager();
+ var target1 = InspectorTest.createMockTarget(targetManager, 1);
+ var target2 = InspectorTest.createMockTarget(targetManager, 2);
+
+ targetManager._targets.push(target1);
+ targetManager._targets.push(target2);
+ var breakpointManager = InspectorTest.createBreakpointManager(targetManager);
+ var uiSourceCode = InspectorTest.addUISourceCode(target1, breakpointManager, "a.js");
+ InspectorTest.setBreakpoint(breakpointManager, uiSourceCode, 30, 0, "", true, step1);
+
+ function step1()
+ {
+ window.setBreakpointCallback = step2;
+ }
+
+ function step2()
+ {
+ InspectorTest.addResult(" First target escaped!")
+ targetManager.removeTarget(target1);
+ InspectorTest.dumpBreakpointLocations(breakpointManager);
+ InspectorTest.finishBreakpointTest(breakpointManager, next);
+ }
+
+ },
+
+ ]);
+};
+
vsevik 2014/06/16 11:12:35 Can we also test debuggerModel disabling?
+</script>
+
+</head>
+
+<body onload="runTest()">
+<p>Tests BreakpointManager class.</p>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698