summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_omnibox_apitest.cc
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 23:38:45 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 23:38:45 +0000
commit8d677ff0f5085bb583d1b8248f977d009ec4b867 (patch)
treea8d1cb7e23128f910a33effde71fb083e5698838 /chrome/browser/extensions/extension_omnibox_apitest.cc
parent14f769f460022e0d28852adc9ff1ce02f4fe2871 (diff)
downloadchromium_src-8d677ff0f5085bb583d1b8248f977d009ec4b867.zip
chromium_src-8d677ff0f5085bb583d1b8248f977d009ec4b867.tar.gz
chromium_src-8d677ff0f5085bb583d1b8248f977d009ec4b867.tar.bz2
Address some visual problems with the omnibox extension API:
- Remove some of the boilerplate strings. - Allow the description field to be fully customizable and stylable. BUG=46478 BUG=46479 Review URL: http://codereview.chromium.org/2849015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50411 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_omnibox_apitest.cc')
-rw-r--r--chrome/browser/extensions/extension_omnibox_apitest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc
index a012d8e..61021b5 100644
--- a/chrome/browser/extensions/extension_omnibox_apitest.cc
+++ b/chrome/browser/extensions/extension_omnibox_apitest.cc
@@ -122,6 +122,30 @@ IN_PROC_BROWSER_TEST_F(OmniboxApiTest, Basic) {
EXPECT_EQ(L"keyword suggestion2", result.match_at(2).fill_into_edit);
EXPECT_EQ(L"keyword suggestion3", result.match_at(3).fill_into_edit);
+ std::wstring description = L"Description with style: <match> [dim], none";
+ EXPECT_EQ(description, result.match_at(1).contents);
+ ASSERT_EQ(5u, result.match_at(1).contents_class.size());
+ EXPECT_EQ(0u,
+ result.match_at(1).contents_class[0].offset);
+ EXPECT_EQ(ACMatchClassification::NONE,
+ result.match_at(1).contents_class[0].style);
+ EXPECT_EQ(description.find('<'),
+ result.match_at(1).contents_class[1].offset);
+ EXPECT_EQ(ACMatchClassification::MATCH,
+ result.match_at(1).contents_class[1].style);
+ EXPECT_EQ(description.find('>'),
+ result.match_at(1).contents_class[2].offset);
+ EXPECT_EQ(ACMatchClassification::NONE,
+ result.match_at(1).contents_class[2].style);
+ EXPECT_EQ(description.find('['),
+ result.match_at(1).contents_class[3].offset);
+ EXPECT_EQ(ACMatchClassification::DIM,
+ result.match_at(1).contents_class[3].style);
+ EXPECT_EQ(description.find(']'),
+ result.match_at(1).contents_class[4].offset);
+ EXPECT_EQ(ACMatchClassification::NONE,
+ result.match_at(1).contents_class[4].style);
+
AutocompleteMatch match = result.match_at(4);
EXPECT_EQ(AutocompleteMatch::SEARCH_WHAT_YOU_TYPED, match.type);
EXPECT_FALSE(match.deletable);