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

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

Issue 10905005: Change browser/page action default icon defined in manifest to support hidpi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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
Index: chrome/common/extensions/extension_unittest.cc
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 72d04c3fb562d16d2373ad3f1fbdb950e89933bd..facc1b2adf487ab90da09659f046ec9130325789 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -46,6 +46,12 @@ namespace errors = extension_manifest_errors;
namespace {
+std::string GetPageActionIconPathAt(const ExtensionAction* action, int index) {
+ const ExtensionIconSet* icon_set = action->page_action_icons()[index];
+ return icon_set->Get(extension_misc::EXTENSION_ICON_ACTION,
+ ExtensionIconSet::MATCH_EXACTLY);
+}
+
void CompareLists(const std::vector<std::string>& expected,
const std::vector<std::string>& actual) {
ASSERT_EQ(expected.size(), actual.size());
@@ -230,9 +236,9 @@ TEST(ExtensionTest, LoadPageActionHelper) {
// No title, so fall back to name.
ASSERT_EQ(name, action->GetTitle(1));
- ASSERT_EQ(2u, action->icon_paths()->size());
- ASSERT_EQ(img1, (*action->icon_paths())[0]);
- ASSERT_EQ(img2, (*action->icon_paths())[1]);
+ ASSERT_EQ(2u, action->page_action_icons().size());
+ ASSERT_EQ(img1, GetPageActionIconPathAt(action.get(), 0));
+ ASSERT_EQ(img2, GetPageActionIconPathAt(action.get(), 1));
// Same test with explicitly set type.
action = LoadAction("page_action_type.json");
@@ -259,7 +265,7 @@ TEST(ExtensionTest, LoadPageActionHelper) {
action = LoadAction("page_action_new_format.json");
ASSERT_TRUE(action.get());
ASSERT_EQ(kTitle, action->GetTitle(1));
- ASSERT_EQ(0u, action->icon_paths()->size());
+ ASSERT_EQ(0u, action->page_action_icons().size());
// Invalid title should give an error even with a valid name.
LoadActionAndExpectError("page_action_invalid_title.json",

Powered by Google App Engine
This is Rietveld 408576698