OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var incognito = chrome.extension.inIncognitoContext; |
| 6 var incognitoSuffix = incognito ? " incognito" : ""; |
| 7 |
| 8 chrome.omnibox.onInputChanged.addListener( |
| 9 function(text, suggest) { |
| 10 chrome.test.log("onInputChanged: " + text); |
| 11 if (text == "suggestio") { |
| 12 // First test, complete "suggestio" |
| 13 var desc = 'Description with style: <match><match></match>, ' + |
| 14 '<dim>[dim]</dim>, <url>(url till end)</url>'; |
| 15 suggest([ |
| 16 {content: text + "n1", description: desc}, |
| 17 {content: text + "n2", description: "description2"}, |
| 18 {content: text + "n3" + incognitoSuffix, description: "description3"}, |
| 19 ]); |
| 20 } else { |
| 21 // Other tests, just provide a simple suggestion. |
| 22 suggest([{content: text + " 1", description: "description"}]); |
| 23 } |
| 24 }); |
| 25 |
| 26 chrome.omnibox.onInputEntered.addListener( |
| 27 function(text) { |
| 28 chrome.test.assertEq("command" + incognitoSuffix, text); |
| 29 chrome.test.notifyPass(); |
| 30 }); |
| 31 |
| 32 // Now we wait for the input events to fire. |
| 33 chrome.test.notifyPass(); |
OLD | NEW |