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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/text-prompt.js

Issue 2513423003: DevTools: Convert inspector-unit tests to use reusable test harness (Closed)
Patch Set: Moved type definition out of externs Created 4 years 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
(Empty)
1 TestRunner.addResult("This tests if the TextPrompt autocomplete works properly." );
2
3 var suggestions = ["heyoo", "hey it's a suggestion", "hey another suggestion"].m ap(s => ({title: s}));
4 var prompt = new UI.TextPrompt();
5 prompt.initialize(() => Promise.resolve(suggestions));
6 var div = document.createElement("div");
7 UI.inspectorView.element.appendChild(div);
8 prompt.attachAndStartEditing(div);
9 prompt.setText("hey");
10 TestRunner.addSniffer(prompt, "_completionsReady").then(step2);
11 prompt.complete();
12 function step2() {
13 TestRunner.addResult("Text:" + prompt.text());
14 TestRunner.addResult("TextWithCurrentSuggestion:" + prompt.textWithCurrentSu ggestion());
15
16 TestRunner.addResult("Test with inexact match:");
17 prompt.clearAutocomplete();
18 prompt.setText("inexactmatch");
19 TestRunner.addSniffer(prompt, "_completionsReady").then(step3);
20 prompt.complete();
21 }
22 function step3() {
23 TestRunner.addResult("Text:" + prompt.text());
24 TestRunner.addResult("TextWithCurrentSuggestion:" + prompt.textWithCurrentSu ggestion());
25 TestRunner.completeTest();
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698