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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html

Issue 2639703002: DevTools: Console: Provide autocompletions for Maps (Closed)
Patch Set: Use [[Entries]] instead of preview Created 3 years, 11 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/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 function templateString() 6 function templateString()
7 { 7 {
8 console.log("The template string should not run and you should not see this log"); 8 console.log("The template string should not run and you should not see this log");
9 return { 9 return {
10 shouldNotFindThis:56 10 shouldNotFindThis:56
11 }; 11 };
12 } 12 }
13 13
14 function shouldNotFindThisFunction() { } 14 function shouldNotFindThisFunction() { }
15 function shouldFindThisFunction() { }
16 window["should not find this"] = true;
15 17
16 window["should not find this"] = true; 18 var myMap = new Map([['first', 1], ['second', 2], ['third', 3], ['shouldNotFindT his', 4]]);
17 19
18 function test() 20 function test()
19 { 21 {
20 var consoleEditor; 22 var consoleEditor;
21 function testCompletions(text, expected, force) 23 function testCompletions(text, expected, force)
22 { 24 {
23 consoleEditor.setText(text); 25 consoleEditor.setText(text);
24 consoleEditor.setSelection(Common.TextRange.createFromLocation(Infinity, Infinity)); 26 consoleEditor.setSelection(Common.TextRange.createFromLocation(Infinity, Infinity));
25 consoleEditor._autocompleteController.autocomplete(force); 27 consoleEditor._autocompleteController.autocomplete(force);
26 return InspectorTest.addSnifferPromise(consoleEditor._autocompleteContro ller, "_onSuggestionsShownForTest").then(checkExpected); 28 return InspectorTest.addSnifferPromise(consoleEditor._autocompleteContro ller, "_onSuggestionsShownForTest").then(checkExpected);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 () => testCompletions("32", ["Float32Array", "Int32Array"]), 64 () => testCompletions("32", ["Float32Array", "Int32Array"]),
63 () => testCompletions("window.32", ["Float32Array", "Int32Array"]), 65 () => testCompletions("window.32", ["Float32Array", "Int32Array"]),
64 () => testCompletions("", ["window"], false), 66 () => testCompletions("", ["window"], false),
65 () => testCompletions("", ["window"], true), 67 () => testCompletions("", ["window"], true),
66 () => testCompletions('"string g', ["getComputedStyle"], false), 68 () => testCompletions('"string g', ["getComputedStyle"], false),
67 () => testCompletions("`template string docu", ["document"], false), 69 () => testCompletions("`template string docu", ["document"], false),
68 () => testCompletions("`${do", ["document"], false), 70 () => testCompletions("`${do", ["document"], false),
69 () => testCompletions("// do", ["document"], false), 71 () => testCompletions("// do", ["document"], false),
70 () => testCompletions('["should', ["shouldNotFindThisFunction"]), 72 () => testCompletions('["should', ["shouldNotFindThisFunction"]),
71 () => testCompletions("shou", ["should not find this"]), 73 () => testCompletions("shou", ["should not find this"]),
74 () => testCompletions('myMap.get(', ['"first")', '"second")', '"third")' ]),
75 () => testCompletions('myMap.get(\'', ['\'first\')', '\'second\')', '\'t hird\')']),
76 () => testCompletions('myMap.set(\'firs', ['\'first\', ']),
77 () => testCompletions('myMap.set(should', ['shouldFindThisFunction', 'sh ouldNotFindThis', '\"shouldNotFindThis\")']),
72 () => testCompletions("document. bo", ["body"]), 78 () => testCompletions("document. bo", ["body"]),
73 () => testCompletions("document.\tbo", ["body"]), 79 () => testCompletions("document.\tbo", ["body"]),
74 () => testCompletions("document.\nbo", ["body"]), 80 () => testCompletions("document.\nbo", ["body"]),
75 () => testCompletions("document.\r\nbo", ["body"]), 81 () => testCompletions("document.\r\nbo", ["body"]),
76 () => testCompletions("document [ 'bo", ["'body']"]), 82 () => testCompletions("document [ 'bo", ["'body']"]),
77 () => testCompletions("function hey(should", ["shouldNotFindThisFunction "]), 83 () => testCompletions("function hey(should", ["shouldNotFindThisFunction "]),
78 () => testCompletions("var should", ["shouldNotFindThisFunction"]), 84 () => testCompletions("var should", ["shouldNotFindThisFunction"]),
79 () => testCompletions("document[[win", ["window"]), 85 () => testCompletions("document[[win", ["window"]),
80 () => testCompletions("document[ [win", ["window"]), 86 () => testCompletions("document[ [win", ["window"]),
81 () => testCompletions("document[ [ win", ["window"]) 87 () => testCompletions("document[ [ win", ["window"])
82 ]).then(InspectorTest.completeTest); 88 ]).then(InspectorTest.completeTest);
83 89
84 } 90 }
85 </script> 91 </script>
86 </head> 92 </head>
87 <body onload="runTest()"> 93 <body onload="runTest()">
88 <p>Tests that console correctly finds suggestions in complicated cases.</p> 94 <p>Tests that console correctly finds suggestions in complicated cases.</p>
89 </body> 95 </body>
90 </html> 96 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698