OLD | NEW |
1 <script> | 1 <script> |
2 chrome.omnibox.onInputChanged.addListener( | 2 chrome.omnibox.onInputChanged.addListener( |
3 function(text, suggest) { | 3 function(text, suggest) { |
4 chrome.test.log("onInputChanged: " + text); | 4 chrome.test.log("onInputChanged: " + text); |
5 if (text != "suggestio") | 5 if (text == "suggestio") { |
6 return; | 6 // First test, complete "suggestio" |
7 | 7 var desc = 'Description with style: <match><match></match>, ' + |
8 var desc = 'Description with style: <match><match></match>, ' + | 8 '<dim>[dim]</dim>, <url>(url till end)</url>'; |
9 '<dim>[dim]</dim>, <url>(url till end)</url>'; | 9 suggest([ |
10 suggest([ | 10 {content: text + "n1", description: desc}, |
11 { | 11 {content: text + "n2", description: "description2"}, |
12 content: text + "n1", | 12 {content: text + "n3", description: "description3"}, |
13 description: desc | 13 ]); |
14 }, | 14 } else { |
15 {content: text + "n2", description: "description2"}, | 15 // Other tests, just provide a simple suggestion. |
16 {content: text + "n3", description: "description3"}, | 16 suggest([{content: text + " 1", description: "description"}]); |
17 ]); | 17 } |
18 }); | 18 }); |
19 | 19 |
20 chrome.omnibox.onInputEntered.addListener( | 20 chrome.omnibox.onInputEntered.addListener( |
21 function(text) { | 21 function(text) { |
22 chrome.test.assertEq("command", text); | 22 chrome.test.assertEq("command", text); |
23 chrome.test.notifyPass(); | 23 chrome.test.notifyPass(); |
24 }); | 24 }); |
25 | 25 |
26 // Now we wait for the input events to fire. | 26 // Now we wait for the input events to fire. |
27 chrome.test.notifyPass(); | 27 chrome.test.notifyPass(); |
28 </script> | 28 </script> |
OLD | NEW |