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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/file-system-project.html

Issue 2417083002: DevTools: introduce WI.UISourceCode.requestMetadata() (Closed)
Patch Set: normalize test + address nit Created 4 years, 2 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
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 src="../http/tests/inspector/debugger-test.js"></script> 4 <script src="../http/tests/inspector/debugger-test.js"></script>
5 <script src="../http/tests/inspector/workspace-test.js"></script> 5 <script src="../http/tests/inspector/workspace-test.js"></script>
6 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script> 6 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script>
7 <script> 7 <script>
8 function test() 8 function test()
9 { 9 {
10 function dumpUISourceCodes(uiSourceCodes, next) 10 function dumpUISourceCodes(uiSourceCodes, next)
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 { 214 {
215 var isolatedFileSystem = WebInspector.isolatedFileSystemManager. fileSystem("file:///var/www3"); 215 var isolatedFileSystem = WebInspector.isolatedFileSystemManager. fileSystem("file:///var/www3");
216 var folders = isolatedFileSystem.gitFolders(); 216 var folders = isolatedFileSystem.gitFolders();
217 folders.sort(); 217 folders.sort();
218 for (var gitFolder of folders) 218 for (var gitFolder of folders)
219 InspectorTest.addResult(gitFolder); 219 InspectorTest.addResult(gitFolder);
220 fs.reportRemoved(); 220 fs.reportRemoved();
221 next(); 221 next();
222 } 222 }
223 }, 223 },
224
225 function testUISourceCodeMetadata(next)
226 {
227 var fs = new InspectorTest.TestFileSystem("file:///var/www3");
228 var file = fs.root.mkdir("test").addFile("hello.js", "123456");
229 fs.reportCreated(function() { });
230 InspectorTest.waitForScriptSource("hello.js", onUISourceCode);
231 var uiSourceCode;
232
233 function onUISourceCode(sourceCode)
234 {
235 uiSourceCode = sourceCode;
236 uiSourceCode.requestMetadata().then(onInitialMetadata);
237 }
238
239 function onInitialMetadata(metadata)
240 {
241 dumpMetadata("Initial metadata", metadata);
242 file.setContent("changed content");
243 uiSourceCode.requestMetadata().then(onChangedMetadata);
244 }
245
246 function onChangedMetadata(metadata)
247 {
248 dumpMetadata("Changed metadata", metadata);
249 fs.reportRemoved();
250 next();
251 }
252
253 function dumpMetadata(label, metadata)
254 {
255 InspectorTest.addResult(label);
256 InspectorTest.addResult(" content size: " + metadata.contentS ize);
257 InspectorTest.addResult(" modification time: " + metadata.mod ificationTime.toISOString());
258 }
259 },
224 ]); 260 ]);
225 }; 261 };
226 </script> 262 </script>
227 </head> 263 </head>
228 <body onload="runTest()"> 264 <body onload="runTest()">
229 <p>Tests file system project.</p> 265 <p>Tests file system project.</p>
230 </body> 266 </body>
231 </html> 267 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698