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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/javascript-outline-dialog.html

Issue 2783233005: DevTools: Move JavaScript and CSS outline into QuickOpen (Closed)
Patch Set: Created 3 years, 8 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 3
4 4
5 <script src="../../http/tests/inspector/inspector-test.js"></script> 5 <script src="../../http/tests/inspector/inspector-test.js"></script>
6 <script src="../../http/tests/inspector/debugger-test.js"></script> 6 <script src="../../http/tests/inspector/debugger-test.js"></script>
7 <script src="./resources/javascript-outline-dialog.js"></script> 7 <script src="./resources/javascript-outline-dialog.js"></script>
8 <script> 8 <script>
9 9
10 function test() 10 function test()
11 { 11 {
12 InspectorTest.showScriptSource("javascript-outline-dialog.js", onSourceShown ); 12 InspectorTest.showScriptSource("javascript-outline-dialog.js", onSourceShown );
13 var provider;
13 function onSourceShown(sourceFrame) 14 function onSourceShown(sourceFrame)
14 { 15 {
15 InspectorTest.addSniffer(Sources.JavaScriptOutlineDialog.prototype, "ref resh", onDialogFulfilled); 16 InspectorTest.addSniffer(Sources.OutlineQuickOpen.prototype, "refresh", onQuickOpenFulfilled);
16 UI.panels.sources._sourcesView._showOutlineDialog(); 17 UI.panels.sources._sourcesView._showOutlineQuickOpen();
17 } 18 }
18 19
19 function onDialogFulfilled() 20 function onQuickOpenFulfilled()
20 { 21 {
22 provider = this;
21 dumpScores("te"); 23 dumpScores("te");
22 dumpScores("test"); 24 dumpScores("test");
23 dumpScores("test("); 25 dumpScores("test(");
24 dumpScores("test(arg"); 26 dumpScores("test(arg");
25 InspectorTest.completeTest(); 27 InspectorTest.completeTest();
26 } 28 }
27 29
28 function dumpScores(query) 30 function dumpScores(query)
29 { 31 {
30 InspectorTest.addResult(`Scores for query="${query}"`); 32 InspectorTest.addResult(`Scores for query="${query}"`);
31 var dialog = Sources.JavaScriptOutlineDialog._instanceForTests;
32 var keys = []; 33 var keys = [];
33 for (var i = 0; i < dialog.itemCount(); ++i) { 34 for (var i = 0; i < provider.itemCount(); ++i) {
34 keys.push({ 35 keys.push({
35 key: dialog.itemKeyAt(i), 36 key: provider.itemKeyAt(i),
36 score: dialog.itemScoreAt(i, query) 37 score: provider.itemScoreAt(i, query)
37 }); 38 });
38 } 39 }
39 keys.sort((a,b) => b.score - a.score); 40 keys.sort((a,b) => b.score - a.score);
40 InspectorTest.addResult(keys.map(a => a.key + " " + a.score).join("\n")) ; 41 InspectorTest.addResult(keys.map(a => a.key + " " + a.score).join("\n")) ;
41 InspectorTest.addResult(""); 42 InspectorTest.addResult("");
42 } 43 }
43 } 44 }
44 45
45 </script> 46 </script>
46 47
47 </head> 48 </head>
48 49
49 <body onload="runTest()"> 50 <body onload="runTest()">
50 <p>Verify JavaScriptOutlineDialog scoring.</p> 51 <p>Verify JavaScriptOutlineDialog scoring.</p>
51 </body> 52 </body>
52 </html> 53 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/css-outline-dialog.html ('k') | third_party/WebKit/Source/devtools/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698