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

Side by Side Diff: chrome/test/data/extensions/api_test/omnibox/test.html

Issue 5271009: Replace 'descriptionStyles' in omnibox API with a simple xml (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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 | Annotate | Revision Log
OLDNEW
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 return;
7 7
8 var desc = 'Description with style: <match>, [dim], (url till end)'; 8 var desc = 'Description with style: <match>&lt;match&gt;</match>, ' +
Matt Perry 2010/11/29 22:06:52 hmm.. one disadvantage of this change is that desc
Aaron Boodman 2010/11/30 01:13:57 True, but that is not too hard to do.
9 '<dim>[dim]</dim>, <url>(url till end)</url>';
9 suggest([ 10 suggest([
10 { 11 {
11 content: text + "n1", 12 content: text + "n1",
12 description: desc, 13 description: desc
13 descriptionStyles: [
14 chrome.omnibox.styleMatch(desc.indexOf('<'), 6),
15 chrome.omnibox.styleDim(desc.indexOf('['), 4),
16 chrome.omnibox.styleUrl(desc.indexOf('(')),
17 ]
18 }, 14 },
19 {content: text + "n2", description: "description2"}, 15 {content: text + "n2", description: "description2"},
20 {content: text + "n3", description: "description3"}, 16 {content: text + "n3", description: "description3"},
21 ]); 17 ]);
22 }); 18 });
23 19
24 chrome.omnibox.onInputEntered.addListener( 20 chrome.omnibox.onInputEntered.addListener(
25 function(text) { 21 function(text) {
26 chrome.test.assertEq("command", text); 22 chrome.test.assertEq("command", text);
27 chrome.test.notifyPass(); 23 chrome.test.notifyPass();
28 }); 24 });
29 25
30 // Now we wait for the input events to fire. 26 // Now we wait for the input events to fire.
31 chrome.test.notifyPass(); 27 chrome.test.notifyPass();
32 </script> 28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698