Chromium Code Reviews| 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> | 5 <script> |
| 6 function test() | 6 async function test() |
| 7 { | 7 { |
| 8 var uiSourceCodes = []; | |
| 9 function addUISourceCode(url) | |
| 10 { | |
| 11 var contentProvider = Common.StaticContentProvider.fromString(url, Commo n.resourceTypes.Script, ""); | |
| 12 var uiSourceCode = Bindings.NetworkProject.forTarget(InspectorTest.mainT arget).addFile(contentProvider, InspectorTest.mainFrame(), false); | |
| 13 uiSourceCodes.push(uiSourceCode); | |
| 14 } | |
| 15 | |
| 16 var files = [ | 8 var files = [ |
| 17 "foo.css", | 9 "foo.css", |
| 18 "foo.js", | 10 "foo.js", |
| 19 "foo.js.map", | 11 "foo.js.map", |
| 20 "foo.ts", | 12 "foo.ts", |
| 21 | 13 |
| 22 "bar.css", | 14 "bar.css", |
| 23 "bar.js", | 15 "bar.js", |
| 24 "bar.js.map", | 16 "bar.js.map", |
| 25 "bar.ts", | 17 "bar.ts", |
| 26 | 18 |
| 27 "baz.css", | 19 "baz.css", |
| 28 "baz2", | 20 "baz2", |
| 29 | 21 |
| 30 "foo/foo.css", | 22 "foo/foo.css", |
| 31 "foo/foo.js", | 23 "foo/foo.js", |
| 32 "foo/foo.js.map", | 24 "foo/foo.js.map", |
| 33 "foo/foo.ts", | 25 "foo/foo.ts", |
| 34 "foo/foo", | 26 "foo/foo", |
| 35 | 27 |
| 36 "bar/foo.css", | 28 "bar/foo.css", |
| 37 "bar/foo.js", | 29 "bar/foo.js", |
| 38 "bar/foo.js.map", | 30 "bar/foo.js.map", |
| 39 "bar/foo.ts", | 31 "bar/foo.ts", |
| 40 "bar/foo" ]; | 32 "bar/foo" ]; |
| 33 files = files.map(file => 'http://example.com/' + file); | |
| 41 | 34 |
| 35 var uiSourceCodes = []; | |
| 42 for (var i = 0; i < files.length; ++i) | 36 for (var i = 0; i < files.length; ++i) |
| 43 addUISourceCode("http://example.com/" + files[i]); | 37 uiSourceCodes.push(await InspectorTest.addScriptUISourceCode(files[i], ' ')); |
|
dgozman
2017/03/16 00:17:10
I can feel how slow (and thus flaky) this is :-(
lushnikov
2017/03/16 06:30:50
Shouldn't be slow, but I migrated this onto PageMo
| |
| 44 | 38 |
| 45 InspectorTest.addResult("Dumping next file for each file:"); | 39 InspectorTest.addResult("Dumping next file for each file:"); |
| 46 for (var i = 0; i < uiSourceCodes.length; ++i) { | 40 for (var i = 0; i < uiSourceCodes.length; ++i) { |
| 47 var uiSourceCode = uiSourceCodes[i]; | 41 var uiSourceCode = uiSourceCodes[i]; |
| 48 var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nex tFile(uiSourceCode); | 42 var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nex tFile(uiSourceCode); |
| 49 var nextURI = nextUISourceCode ? nextUISourceCode.url() : "<none>"; | 43 var nextURI = nextUISourceCode ? nextUISourceCode.url() : "<none>"; |
| 50 InspectorTest.addResult("Next file for " + uiSourceCode.url() + " is " + nextURI + "."); | 44 InspectorTest.addResult("Next file for " + uiSourceCode.url() + " is " + nextURI + "."); |
| 51 } | 45 } |
| 52 InspectorTest.completeTest(); | 46 InspectorTest.completeTest(); |
| 53 } | 47 } |
| 54 </script> | 48 </script> |
| 55 </head> | 49 </head> |
| 56 <body onload="runTest()"> | 50 <body onload="runTest()"> |
| 57 <p>Tests how switch to next file with the same name and different extension feat ure works.</p> | 51 <p>Tests how switch to next file with the same name and different extension feat ure works.</p> |
| 58 </body> | 52 </body> |
| 59 </html> | 53 </html> |
| OLD | NEW |