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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-move-breakpoints.html

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: DevTools: add persistence/ module Created 4 years, 3 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../debugger-test.js"></script>
5 <script src="../workspace-test.js"></script>
6 <script src="../isolated-filesystem-test.js"></script>
7 <script src="./persistence-test.js"></script>
8 <script src="./resources/foo.js"></script>
9 <script>
10
11 function test()
12 {
13 var fs = new InspectorTest.TestFileSystem("file:///var/www");
14 var fsEntry = fs.root.mkdir("inspector").mkdir("persistence").mkdir("resourc es").addFile("foo.js", "window.foo = ()=>'foo';");
15
16 InspectorTest.runTestSuite([
17 function addFileSystem(next)
18 {
19 fs.reportCreated(next);
20 },
21
22 function setBreakpointInFileSystemUISourceCode(next)
23 {
24 InspectorTest.waitForUISourceCode("foo.js", WebInspector.projectType s.FileSystem)
25 .then(code => InspectorTest.showUISourceCodePromise(code))
26 .then(onSourceFrame);
27
28 function onSourceFrame(sourceFrame)
29 {
30 InspectorTest.setBreakpoint(sourceFrame, 0, "", true);
31 dumpBreakpointSidebarPane();
32 next();
33 }
34 },
35
36 function addFileMapping(next)
37 {
38 InspectorTest.waitForBinding("foo.js", onBindingCreated);
39 WebInspector.fileSystemMapping.addFileSystem(fs.fileSystemPath);
40 WebInspector.fileSystemMapping.addFileMapping(fs.fileSystemPath, "ht tp://127.0.0.1:8000", "/");
41
42 function onBindingCreated(binding)
43 {
44 dumpBreakpointSidebarPane();
45 next();
46 }
47 },
48
49 function removeFileMapping(next)
50 {
51 WebInspector.persistence.addEventListener(WebInspector.Persistence.E vents.BindingRemoved, onBindingRemoved);
52 WebInspector.fileSystemMapping.removeFileMapping(fs.fileSystemPath, "http://127.0.0.1:8000", "/");
53
54 function onBindingRemoved(event)
55 {
56 var binding = event.data;
57 if (binding.network.name() !== "foo.js")
58 return
59 WebInspector.persistence.removeEventListener(WebInspector.Persis tence.Events.BindingRemoved, onBindingRemoved);
60 dumpBreakpointSidebarPane();
61 next();
62 }
63 },
64 ]);
65
66 function dumpBreakpointSidebarPane()
67 {
68 var sidebarPane = self.runtime.sharedInstance(WebInspector.JavaScriptBre akpointsSidebarPane)
69 var breakpoints = sidebarPane._items.keysArray();
70 var urls = breakpoints.map(breakpoint => breakpoint.uiSourceCode().url() );
71 for (var url of urls)
72 InspectorTest.addResult(" " + url);
73 }
74 };
75 </script>
76 </head>
77 <body onload="runTest()">
78 <p>Verify that breakpoints are moved appropriately</p>
79 </body>
80 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698