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