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

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

Issue 2480423002: DevTools: Use CodeMirror syntax highlighting to improve JS autocomplete (Closed)
Patch Set: Add a test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
index 06f1071a68e735760b5e87792fa5f2645fb70496..7b910b1eef98b9dd1ec700149e0eda085d5e6c0f 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
@@ -13,16 +13,21 @@ function templateString()
function test()
{
- function testCompletions(base, prefix, expected)
+ function testCompletions(base, prefix, expected, force, token)
{
var callback;
var promise = new Promise(fulfill => callback = fulfill);
- WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(base, prefix).then(checkExpected);
+ WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(base, prefix, force, token).then(checkExpected);
return promise;
function checkExpected(completions)
{
- InspectorTest.addResult("Checking '" + base + prefix + "'");
+ var message = "Checking '" + base + prefix + "'";
+ if (force)
+ message += " forcefully";
+ if (token)
+ message += " with token " + token;
+ InspectorTest.addResult(message);
for (var i = 0; i < expected.length; i++)
InspectorTest.addResult(((completions.indexOf(expected[i]) !== -1) ? "Found" : "Not Found") + ": " + expected[i]);
InspectorTest.addResult("");
@@ -51,7 +56,12 @@ function test()
() => testCompletions("window.", "dOcUmE", ["document"]),
() => testCompletions("window.", "node", ["NodeList", "AudioNode", "GainNode"]),
() => testCompletions("", "32", ["Float32Array", "Int32Array"]),
- () => testCompletions("window.", "32", ["Float32Array", "Int32Array"])
+ () => testCompletions("window.", "32", ["Float32Array", "Int32Array"]),
+ () => testCompletions("", "", ["window"], false),
+ () => testCompletions("", "", ["window"], true),
einbinder 2016/11/07 23:06:06 Bonus test of forced/unforced completions.
+ () => testCompletions("", "g", ["getComputedStyle"], false, "js-string"),
+ () => testCompletions("window.", "docu", ["document"], false, "js-string-2"),
+ () => testCompletions("window[", '"docu', ['"document"]'], false, "js-string")
]).then(InspectorTest.completeTest);
}

Powered by Google App Engine
This is Rietveld 408576698