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: third_party/WebKit/LayoutTests/inspector/file-system-mapping.html

Issue 2529303003: DevTools: move FileSystemMapping from Workspace to Persistence (Closed)
Patch Set: fix tests Created 4 years 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script> 4 <script>
5 function test() 5 function test()
6 { 6 {
7 var paths = { 7 var paths = {
8 FOO: "file:///home/username/projects/foo", 8 FOO: "file:///home/username/projects/foo",
9 BAR: "file:///home/username/projects/bar", 9 BAR: "file:///home/username/projects/bar",
10 BUILD: "file:///home/username/project/build", 10 BUILD: "file:///home/username/project/build",
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 var entries = fileSystemMapping.mappingEntries(fileSystemPaths[i]); 80 var entries = fileSystemMapping.mappingEntries(fileSystemPaths[i]);
81 for (var j = 0; j < entries.length; ++j) { 81 for (var j = 0; j < entries.length; ++j) {
82 var entry = entries[j]; 82 var entry = entries[j];
83 InspectorTest.addResult(" - " + JSON.stringify(entri es[j])); 83 InspectorTest.addResult(" - " + JSON.stringify(entri es[j]));
84 } 84 }
85 } 85 }
86 InspectorTest.addResult(""); 86 InspectorTest.addResult("");
87 } 87 }
88 88
89 // At first create file system mapping and clear it. 89 // At first create file system mapping and clear it.
90 var fileSystemMapping = new Workspace.FileSystemMapping(Workspace.isolatedFi leSystemManager); 90 var fileSystemMapping = new Persistence.FileSystemMapping(Workspace.isolated FileSystemManager);
91 var fileSystemPaths = Object.keys(fileSystemMapping._fileSystemMappings); 91 var fileSystemPaths = Object.keys(fileSystemMapping._fileSystemMappings);
92 for (var i = 0; i < fileSystemPaths.length; ++i) 92 for (var i = 0; i < fileSystemPaths.length; ++i)
93 fileSystemMapping.removeFileSystem(fileSystemPaths[i]); 93 fileSystemMapping.removeFileSystem(fileSystemPaths[i]);
94 94
95 // Now fill it with file systems. 95 // Now fill it with file systems.
96 checkAndDumpFileSystemMapping(fileSystemMapping); 96 checkAndDumpFileSystemMapping(fileSystemMapping);
97 addFileSystem(fileSystemMapping, paths.FOO) 97 addFileSystem(fileSystemMapping, paths.FOO)
98 addFileSystem(fileSystemMapping, paths.BAR) 98 addFileSystem(fileSystemMapping, paths.BAR)
99 addFileSystem(fileSystemMapping, paths.BUILD) 99 addFileSystem(fileSystemMapping, paths.BUILD)
100 addFileSystem(fileSystemMapping, paths.SITE1) 100 addFileSystem(fileSystemMapping, paths.SITE1)
(...skipping 23 matching lines...) Expand all
124 dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/foo2/folder/42.js "); 124 dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/foo2/folder/42.js ");
125 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/index.htm l"); 125 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/index.htm l");
126 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/index.html"); 126 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/index.html");
127 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo"); 127 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo");
128 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/"); 128 dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/");
129 InspectorTest.addResult(""); 129 InspectorTest.addResult("");
130 130
131 // Then create another file mapping to make sure it is correctly restored fr om the settings. 131 // Then create another file mapping to make sure it is correctly restored fr om the settings.
132 InspectorTest.addResult("Creating another file system mapping."); 132 InspectorTest.addResult("Creating another file system mapping.");
133 fileSystemMapping.dispose(); 133 fileSystemMapping.dispose();
134 var fileSystemMapping = new Workspace.FileSystemMapping(Workspace.isolatedFi leSystemManager); 134 var fileSystemMapping = new Persistence.FileSystemMapping(Workspace.isolated FileSystemManager);
135 checkAndDumpFileSystemMapping(fileSystemMapping); 135 checkAndDumpFileSystemMapping(fileSystemMapping);
136 136
137 // Now remove file mappings. 137 // Now remove file mappings.
138 removeMappingForURL(fileSystemMapping, "http://www.bar.com/foo/folder/42.js" ); 138 removeMappingForURL(fileSystemMapping, "http://www.bar.com/foo/folder/42.js" );
139 removeFileMapping(fileSystemMapping, paths.SITE1, "http://localhost/", "/"); 139 removeFileMapping(fileSystemMapping, paths.SITE1, "http://localhost/", "/");
140 removeFileMapping(fileSystemMapping, paths.SITE1, "http://www.foo.com/", "/f oo/"); 140 removeFileMapping(fileSystemMapping, paths.SITE1, "http://www.foo.com/", "/f oo/");
141 removeFileMapping(fileSystemMapping, paths.FOO, "http://www.example.com/bar/ ", "/foo/"); 141 removeFileMapping(fileSystemMapping, paths.FOO, "http://www.example.com/bar/ ", "/foo/");
142 142
143 // Now remove file systems. 143 // Now remove file systems.
144 removeFileSystem(fileSystemMapping, paths.SITE1) 144 removeFileSystem(fileSystemMapping, paths.SITE1)
145 removeFileSystem(fileSystemMapping, paths.FOO) 145 removeFileSystem(fileSystemMapping, paths.FOO)
146 removeFileSystem(fileSystemMapping, paths.BAR) 146 removeFileSystem(fileSystemMapping, paths.BAR)
147 147
148 InspectorTest.completeTest(); 148 InspectorTest.completeTest();
149 } 149 }
150 </script> 150 </script>
151 </head> 151 </head>
152 <body onload="runTest()"> 152 <body onload="runTest()">
153 <p>Tests FileSystemMapping</p> 153 <p>Tests FileSystemMapping</p>
154 </body> 154 </body>
155 </html> 155 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698