Index: chrome/browser/extensions/api/omnibox/omnibox_unittest.cc |
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_unittest.cc b/chrome/browser/extensions/api/omnibox/omnibox_unittest.cc |
index c357fc8f8880475991e90593eda59245f2561af9..f1ab1ed65221c9155d086e378835f981827b5ba7 100644 |
--- a/chrome/browser/extensions/api/omnibox/omnibox_unittest.cc |
+++ b/chrome/browser/extensions/api/omnibox/omnibox_unittest.cc |
@@ -13,6 +13,7 @@ namespace extensions { |
namespace omnibox = api::omnibox; |
namespace SendSuggestions = omnibox::SendSuggestions; |
+namespace SetDefaultSuggestion = omnibox::SetDefaultSuggestion; |
namespace { |
@@ -232,4 +233,43 @@ TEST(ExtensionOmniboxTest, DescriptionStylesCombine2) { |
*params->suggest_results[0])); |
} |
+// 0123456789 |
+// uuuuu |
+// + mmmmm |
+// + mmm |
+// + ddd |
+// + ddd |
+// = 77777nnnnn |
+TEST(ExtensionOmniboxTest, DefaultSuggestResult) { |
+ // Default suggestions should not have a content parameter. |
+ scoped_ptr<ListValue> list = ListBuilder() |
+ .Append(DictionaryBuilder() |
+ .Set("description", "description") |
+ .Set("descriptionStyles", ListBuilder() |
+ .Append(DictionaryBuilder() |
+ .Set("type", "url") |
+ .Set("offset", 0) |
+ .Set("length", 5)) |
+ .Append(DictionaryBuilder() |
+ .Set("type", "match") |
+ .Set("offset", 0) |
+ .Set("length", 5)) |
+ .Append(DictionaryBuilder() |
+ .Set("type", "match") |
+ .Set("offset", 0) |
+ .Set("length", 3)) |
+ .Append(DictionaryBuilder() |
+ .Set("type", "dim") |
+ .Set("offset", 2) |
+ .Set("length", 3)) |
+ .Append(DictionaryBuilder() |
+ .Set("type", "dim") |
+ .Set("offset", 0) |
+ .Set("length", 3)))).Build(); |
+ |
+ scoped_ptr<SetDefaultSuggestion::Params> params( |
+ SetDefaultSuggestion::Params::Create(*list)); |
+ EXPECT_TRUE(params); |
+} |
+ |
} // namespace extensions |