Index: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..69f66e1124208313f1f85ae05f014d5c64ce8d88 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html |
@@ -0,0 +1,79 @@ |
+<html> |
+<head> |
+<script src="../inspector-test.js"></script> |
+<script src="../debugger-test.js"></script> |
+<script src="../workspace-test.js"></script> |
+<script src="../isolated-filesystem-test.js"></script> |
+<script src="./persistence-test.js"></script> |
+<script src="./resources/foo.js"></script> |
+<script> |
+ |
+function test() |
+{ |
+ var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
+ var fsEntry = InspectorTest.addFooJSFile(fs); |
+ |
+ InspectorTest.runTestSuite([ |
+ function addFileSystem(next) |
+ { |
+ fs.reportCreated(next); |
+ }, |
+ |
+ function setBreakpointInFileSystemUISourceCode(next) |
+ { |
+ InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectTypes.FileSystem) |
+ .then(code => InspectorTest.showUISourceCodePromise(code)) |
+ .then(onSourceFrame); |
+ |
+ function onSourceFrame(sourceFrame) |
+ { |
+ InspectorTest.setBreakpoint(sourceFrame, 0, "", true); |
+ dumpBreakpointSidebarPane(); |
+ next(); |
+ } |
+ }, |
+ |
+ function addFileMapping(next) |
+ { |
+ InspectorTest.waitForBinding("foo.js").then(onBindingCreated); |
+ WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); |
+ |
+ function onBindingCreated(binding) |
+ { |
+ dumpBreakpointSidebarPane(); |
+ next(); |
+ } |
+ }, |
+ |
+ function removeFileMapping(next) |
+ { |
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); |
+ WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/"); |
+ |
+ function onBindingRemoved(event) |
+ { |
+ var binding = event.data; |
+ if (binding.network.name() !== "foo.js") |
+ return |
+ WebInspector.persistence.removeEventListener(WebInspector.Persistence.Events.BindingRemoved, onBindingRemoved); |
+ dumpBreakpointSidebarPane(); |
+ next(); |
+ } |
+ }, |
+ ]); |
+ |
+ function dumpBreakpointSidebarPane() |
+ { |
+ var sidebarPane = self.runtime.sharedInstance(WebInspector.JavaScriptBreakpointsSidebarPane) |
+ var breakpoints = sidebarPane._items.keysArray(); |
+ var urls = breakpoints.map(breakpoint => breakpoint.uiSourceCode().url()); |
+ for (var url of urls) |
+ InspectorTest.addResult(" " + url); |
dgozman
2016/09/23 23:03:20
Let's add the line.
lushnikov
2016/09/24 00:30:50
Done.
|
+ } |
+}; |
+</script> |
+</head> |
+<body onload="runTest()"> |
+<p>Verify that breakpoints are moved appropriately</p> |
+</body> |
+</html> |