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

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: 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 () => testCompletions("window.node", ["NodeList", "AudioNode", "GainNode "]), 63 () => testCompletions("window.node", ["NodeList", "AudioNode", "GainNode "]),
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\")'])
78
72 ]).then(InspectorTest.completeTest); 79 ]).then(InspectorTest.completeTest);
73 80
74 } 81 }
75 </script> 82 </script>
76 </head> 83 </head>
77 <body onload="runTest()"> 84 <body onload="runTest()">
78 <p>Tests that console correctly finds suggestions in complicated cases.</p> 85 <p>Tests that console correctly finds suggestions in complicated cases.</p>
79 </body> 86 </body>
80 </html> 87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698