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

Unified Diff: chrome/common/extensions/extension_unittest.cc

Issue 271117: Limit extensions to 1 UI surface (either Page/Browser action, but not both).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unittest.cc
===================================================================
--- chrome/common/extensions/extension_unittest.cc (revision 29153)
+++ chrome/common/extensions/extension_unittest.cc (working copy)
@@ -219,6 +219,18 @@
privacy_blacklists->Set(0, Value::CreateIntegerValue(42));
EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error));
EXPECT_TRUE(MatchPattern(error, errors::kInvalidPrivacyBlacklistsPath));
+
+ // Test invalid UI surface count (both page action and browser action).
+ input_value.reset(static_cast<DictionaryValue*>(valid_value->DeepCopy()));
+ DictionaryValue* action = new DictionaryValue;
+ action->SetString(keys::kPageActionId, "MyExtensionActionId");
+ action->SetString(keys::kName, "MyExtensionActionName");
+ ListValue* action_list = new ListValue;
+ action_list->Append(action->DeepCopy());
+ input_value->Set(keys::kPageActions, action_list);
+ input_value->Set(keys::kBrowserAction, action);
+ EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error));
+ EXPECT_STREQ(error.c_str(), errors::kOneUISurfaceOnly);
}
TEST(ExtensionTest, InitFromValueValid) {
@@ -401,7 +413,7 @@
ASSERT_TRUE(NULL != action.get());
// Now test that we can parse the new format for page actions.
-
+
// Now setup some values to use in the page action.
const std::string kTitle("MyExtensionActionTitle");
const std::string kIcon("image1.png");
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698