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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/switch-file.html

Issue 2747863007: DevTools: clean up tests to not depend on NetworkProject.addFile method (Closed)
Patch Set: typo Created 3 years, 9 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/page-mock.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
42 for (var i = 0; i < files.length; ++i) 35 var page = new InspectorTest.PageMock('http://example.com');
43 addUISourceCode("http://example.com/" + files[i]); 36 InspectorTest.connectToPage('mock-page', page);
37
38 var uiSourceCodes = [];
39 for (var i = 0; i < files.length; ++i) {
40 page.evalScript(files[i], '', false /* isContentScript */);
41 uiSourceCodes.push(await InspectorTest.waitForUISourceCode(files[i]));
42 }
44 43
45 InspectorTest.addResult("Dumping next file for each file:"); 44 InspectorTest.addResult("Dumping next file for each file:");
46 for (var i = 0; i < uiSourceCodes.length; ++i) { 45 for (var i = 0; i < uiSourceCodes.length; ++i) {
47 var uiSourceCode = uiSourceCodes[i]; 46 var uiSourceCode = uiSourceCodes[i];
48 var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nex tFile(uiSourceCode); 47 var nextUISourceCode = Sources.SourcesView.SwitchFileActionDelegate._nex tFile(uiSourceCode);
49 var nextURI = nextUISourceCode ? nextUISourceCode.url() : "<none>"; 48 var nextURI = nextUISourceCode ? nextUISourceCode.url() : "<none>";
50 InspectorTest.addResult("Next file for " + uiSourceCode.url() + " is " + nextURI + "."); 49 InspectorTest.addResult("Next file for " + uiSourceCode.url() + " is " + nextURI + ".");
51 } 50 }
52 InspectorTest.completeTest(); 51 InspectorTest.completeTest();
53 } 52 }
54 </script> 53 </script>
55 </head> 54 </head>
56 <body onload="runTest()"> 55 <body onload="runTest()">
57 <p>Tests how switch to next file with the same name and different extension feat ure works.</p> 56 <p>Tests how switch to next file with the same name and different extension feat ure works.</p>
58 </body> 57 </body>
59 </html> 58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698