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

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

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 <html>
2 <head>
3 <base href="/inspector-debug/"></base>
4 <script src="/inspector-debug/Runtime.js"></script>
5 <script src="/inspector-unit/inspector-unit-test.js"></script>
6 <script>
7 function test() {
8 var suggestions = ["heyoo", "hey it's a suggestion", "hey another suggestion "].map(s => ({title: s}));
9 var prompt = new UI.TextPrompt();
10 prompt.initialize(() => Promise.resolve(suggestions));
11 var div = document.createElement("div");
12 UI.inspectorView.element.appendChild(div);
13 prompt.attachAndStartEditing(div);
14 prompt.setText("hey");
15 UnitTest.addSniffer(prompt, "_completionsReady").then(step2);
16 prompt.complete();
17 function step2() {
18 UnitTest.addResult("Text:" + prompt.text());
19 UnitTest.addResult("TextWithCurrentSuggestion:" + prompt.textWithCurrent Suggestion());
20
21 UnitTest.addResult("Test with inexact match:");
22 prompt.clearAutocomplete();
23 prompt.setText("inexactmatch");
24 UnitTest.addSniffer(prompt, "_completionsReady").then(step3);
25 prompt.complete();
26 }
27 function step3() {
28 UnitTest.addResult("Text:" + prompt.text());
29 UnitTest.addResult("TextWithCurrentSuggestion:" + prompt.textWithCurrent Suggestion());
30 UnitTest.completeTest();
31 }
32 }
33 </script>
34 </head>
35 <body>
36 This tests if the TextPrompt autocomplete works properly.
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698