diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 07:51:06 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 07:51:06 +0000 |
commit | c3e3def74b9eec14e63b08649204b6c721c79d3c (patch) | |
tree | 8150e6f89fa6d6da2ebade890b083c08e817fb40 /chrome/common/extensions/extension_unittest.cc | |
parent | 6b7a13eef79fffe763d86ebbee9d5fc4839fc86d (diff) | |
download | chromium_src-c3e3def74b9eec14e63b08649204b6c721c79d3c.zip chromium_src-c3e3def74b9eec14e63b08649204b6c721c79d3c.tar.gz chromium_src-c3e3def74b9eec14e63b08649204b6c721c79d3c.tar.bz2 |
A small start: add icons to the extension manifest.
Review URL: http://codereview.chromium.org/155662
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_unittest.cc')
-rw-r--r-- | chrome/common/extensions/extension_unittest.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index 2b5382c..65ade63 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -75,6 +75,21 @@ TEST(ExtensionTest, InitFromValueInvalid) { EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error)); EXPECT_EQ(errors::kInvalidDescription, error); + // Test invalid icons + input_value.reset(static_cast<DictionaryValue*>(valid_value->DeepCopy())); + input_value->SetInteger(keys::kIcons, 42); + EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error)); + EXPECT_EQ(errors::kInvalidIcons, error); + + // Test invalid icon paths + input_value.reset(static_cast<DictionaryValue*>(valid_value->DeepCopy())); + DictionaryValue* icons = NULL; + input_value->GetDictionary(keys::kIcons, &icons); + ASSERT_FALSE(NULL == icons); + icons->SetInteger(ASCIIToWide(IntToString(128)), 42); + EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error)); + EXPECT_TRUE(MatchPattern(error, errors::kInvalidIconPath)); + // Test invalid user scripts list input_value.reset(static_cast<DictionaryValue*>(valid_value->DeepCopy())); input_value->SetInteger(keys::kContentScripts, 42); @@ -271,7 +286,7 @@ TEST(ExtensionTest, LoadPageActionHelper) { ListValue* icons = new ListValue; icons->Set(0, Value::CreateStringValue(img1)); icons->Set(1, Value::CreateStringValue(img2)); - input.Set(keys::kIconPaths, icons); + input.Set(keys::kPageActionIcons, icons); // Parse the page action and read back the values from the object. page_action.reset(extension.LoadPageActionHelper(&input, 0, &error_msg)); @@ -321,7 +336,7 @@ TEST(ExtensionTest, LoadPageActionHelper) { // Then remove the icon paths key. copy.reset(static_cast<DictionaryValue*>(input.DeepCopy())); - copy->Remove(keys::kIconPaths, NULL); + copy->Remove(keys::kPageActionIcons, NULL); page_action.reset(extension.LoadPageActionHelper(copy.get(), 0, &error_msg)); ASSERT_TRUE(NULL == page_action.get()); ASSERT_TRUE(MatchPattern(error_msg.c_str(), |