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

Side by Side Diff: LayoutTests/inspector/debugger/scripts-sorting.html

Issue 8222004: Merge 96319 - Web Inspector: Scripts panel without folders causes errors when creating content sc... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 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 5
6 <script> 6 <script>
7 var scripts = [
8 "block.js?block=foo",
9 "ga.js",
10 "lenta.ban?pg=4883&ifr=1",
11 "lenta.ban?pg=5309&ifr=1",
12 "top100.jcn?80674",
13 "_js/production/motor.js?1308927432",
14 "i/xgemius.js",
15 "i/js/jquery-1.5.1.min.js",
16 "i/js/jquery.cookie.js",
17 "foo/path/bar.js?file=bar/zzz.js",
18 "foo/path/foo.js?file=bar/aaa.js" ];
19
20 for (var i = 0; i < scripts.length; ++i)
21 window.eval("function func" + i + "() {} //@ sourceURL=http://foo.com/" + sc ripts[i]);
22
23 window.eval("function funcNonURL() {} //@ sourceURL=*Non*URL*path");
24
25 </script>
26
27 <script>
28 function test() 7 function test()
29 { 8 {
30 var scripts = []; 9 // Always use indentation in scripts drop box
10 WebInspector._isMac = false;
11
31 InspectorTest.startDebuggerTest(step1); 12 InspectorTest.startDebuggerTest(step1);
32 13
33 function step1() 14 function step1()
34 { 15 {
16 var scripts = [
17 "block.js?block=foo",
18 "ga.js",
19 "lenta.ban?pg=4883&ifr=1",
20 "lenta.ban?pg=5309&ifr=1",
21 "top100.jcn?80674",
22 "_js/production/motor.js?1308927432",
23 "i/xgemius.js",
24 "i/js/jquery-1.5.1.min.js",
25 "i/js/jquery.cookie.js",
26 "foo/path/bar.js?file=bar/zzz.js",
27 "foo/path/foo.js?file=bar/aaa.js" ];
28 for (var i = 0; i < scripts.length; ++i)
29 addOption("http://foo.com/" + scripts[i]);
30
31 var scripts2 = [
32 "foo/path/bar.js?file=bar/zzz.js",
33 "foo/path/foo.js?file=bar/aaa.js" ];
34 for (var i = 0; i < scripts2.length; ++i)
35 addOption("http://bar.com/" + scripts2[i]);
36 addOption("*Non*URL*path");
37
38 var extensions = [
39 "extension-schema://extension-name/bar.js",
40 "extension-schema://extension-name/folder/baz.js" ];
41 for (var i = 0; i < extensions.length; ++i)
42 addOption(extensions[i], true);
43 addOption("*Non*URL*path", true);
44
35 try { 45 try {
36 dumpScriptsList(); 46 dumpScriptsList();
37 WebInspector.settings.showScriptFolders.set(false); 47 WebInspector.settings.showScriptFolders.set(false);
38 dumpScriptsList(); 48 dumpScriptsList();
39 } finally { 49 } finally {
40 WebInspector.settings.showScriptFolders.set(true); 50 WebInspector.settings.showScriptFolders.set(true);
41 } 51 }
42 dumpScriptsList(); 52 dumpScriptsList();
43 InspectorTest.completeDebuggerTest(); 53 InspectorTest.completeDebuggerTest();
44 } 54 }
45 55
56 var nextId = 1;
57
58 function addOption(url, isContentScript)
59 {
60 WebInspector.panels.scripts._addOptionToFilesSelect({ id: nextId++, url: url, isContentScript: isContentScript });
61 }
62
46 function dumpScriptsList() 63 function dumpScriptsList()
47 { 64 {
48 InspectorTest.addResult(""); 65 InspectorTest.addResult("");
49 InspectorTest.addResult("WebInspector.settings.showScriptFolders = " + W ebInspector.settings.showScriptFolders.get()); 66 InspectorTest.addResult("WebInspector.settings.showScriptFolders = " + W ebInspector.settings.showScriptFolders.get());
50 var select = WebInspector.panels.scripts._filesSelectElement; 67 var select = WebInspector.panels.scripts._filesSelectElement;
51 for (var i = 0; i < select.length; ++i) { 68 for (var i = 0; i < select.length; ++i) {
52 var text = select[i].textContent.replace(/\u00a0/g, " "); 69 if (select[i]._uiSourceCode && select[i]._uiSourceCode.url.indexOf(" LayoutTests/") !== -1)
53 if (select[i].nameForSorting.indexOf("LayoutTests/") !== -1)
54 continue; 70 continue;
55 InspectorTest.addResult(text); 71 if (select[i].textContent.indexOf("LayoutTests/") !== -1)
72 continue;
73 InspectorTest.addResult(select[i].textContent.replace(/\u00a0/g, " " ));
56 } 74 }
57 } 75 }
58 } 76 }
59 </script> 77 </script>
60 78
61 </head> 79 </head>
62 <body onload="runTest()"> 80 <body onload="runTest()">
63 <p> 81 <p>
64 Tests scripts sorting in the scripts panel. 82 Tests scripts sorting in the scripts panel.
65 </p> 83 </p>
66 </body> 84 </body>
67 85
68 </html> 86 </html>
OLDNEW
« no previous file with comments | « LayoutTests/inspector/debugger/scripts-panel-expected.txt ('k') | LayoutTests/inspector/debugger/scripts-sorting-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698