OLD | NEW |
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/isolated-filesystem-test.js"></script> | 5 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script> |
6 <script> | 6 <script> |
7 function test() | 7 function test() |
8 { | 8 { |
9 function fileSystemUISourceCodes() | 9 function fileSystemUISourceCodes() |
10 { | 10 { |
11 var uiSourceCodes = []; | 11 var uiSourceCodes = []; |
12 var fileSystemProjects = Workspace.workspace.projectsForType(Workspace.p
rojectTypes.FileSystem); | 12 var fileSystemProjects = Workspace.workspace.projectsForType(Workspace.p
rojectTypes.FileSystem); |
13 for (var project of fileSystemProjects) | 13 for (var project of fileSystemProjects) |
14 uiSourceCodes = uiSourceCodes.concat(project.uiSourceCodes()); | 14 uiSourceCodes = uiSourceCodes.concat(project.uiSourceCodes()); |
15 return uiSourceCodes; | 15 return uiSourceCodes; |
16 } | 16 } |
17 | 17 |
18 function dumpUISourceCode(uiSourceCode, callback) | 18 function dumpUISourceCode(uiSourceCode, callback) |
19 { | 19 { |
20 InspectorTest.addResult("UISourceCode: " + uiSourceCode.url().replace(/.
*LayoutTests/, "LayoutTests")); | 20 InspectorTest.addResult("UISourceCode: " + uiSourceCode.url().replace(/.
*LayoutTests/, "LayoutTests")); |
21 if (uiSourceCode.contentType() === Common.resourceTypes.Script || uiSour
ceCode.contentType() === Common.resourceTypes.Document) | 21 if (uiSourceCode.contentType() === Common.resourceTypes.Script || uiSour
ceCode.contentType() === Common.resourceTypes.Document) |
22 InspectorTest.addResult("UISourceCode is content script: " + (uiSour
ceCode.project().type() === Workspace.projectTypes.ContentScripts)); | 22 InspectorTest.addResult("UISourceCode is content script: " + (uiSour
ceCode.project().type() === Workspace.projectTypes.ContentScripts)); |
23 uiSourceCode.requestContent().then(didRequestContent); | 23 uiSourceCode.requestContent().then(didRequestContent); |
24 | 24 |
25 function didRequestContent(content, contentEncoded) | 25 function didRequestContent(content, contentEncoded) |
26 { | 26 { |
27 InspectorTest.addResult("Highlighter type: " + Bindings.NetworkProje
ct.uiSourceCodeMimeType(uiSourceCode)); | 27 InspectorTest.addResult("Highlighter type: " + uiSourceCode.mimeType
()); |
28 InspectorTest.addResult("UISourceCode content: " + content); | 28 InspectorTest.addResult("UISourceCode content: " + content); |
29 callback(); | 29 callback(); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 function dumpUISourceCodes(uiSourceCodes, next) | 33 function dumpUISourceCodes(uiSourceCodes, next) |
34 { | 34 { |
35 innerDumpUISourceCodes(uiSourceCodes, 0, next); | 35 innerDumpUISourceCodes(uiSourceCodes, 0, next); |
36 | 36 |
37 function innerDumpUISourceCodes(uiSourceCodes, startIndex, next) | 37 function innerDumpUISourceCodes(uiSourceCodes, startIndex, next) |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 292 } |
293 } | 293 } |
294 ]); | 294 ]); |
295 }; | 295 }; |
296 </script> | 296 </script> |
297 </head> | 297 </head> |
298 <body onload="runTest()"> | 298 <body onload="runTest()"> |
299 <p>Tests file system project.</p> | 299 <p>Tests file system project.</p> |
300 </body> | 300 </body> |
301 </html> | 301 </html> |
OLD | NEW |