| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/memory/linked_ptr.h" | 5 #include "base/memory/linked_ptr.h" |
| 6 #include "chrome/common/extensions/extension.h" | 6 #include "chrome/common/extensions/extension.h" |
| 7 #include "chrome/common/extensions/extension_constants.h" | 7 #include "chrome/common/extensions/extension_constants.h" |
| 8 #include "chrome/common/extensions/extension_icon_set.h" | 8 #include "chrome/common/extensions/extension_icon_set.h" |
| 9 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 9 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 10 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 10 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class IconsManifestTest : public ExtensionManifestTest { | 15 class IconsManifestTest : public ExtensionManifestTest { |
| 16 protected: | |
| 17 virtual void SetUp() OVERRIDE { | |
| 18 ExtensionManifestTest::SetUp(); | |
| 19 (new IconsHandler)->Register(); | |
| 20 } | |
| 21 }; | 16 }; |
| 22 | 17 |
| 23 TEST_F(IconsManifestTest, NormalizeIconPaths) { | 18 TEST_F(IconsManifestTest, NormalizeIconPaths) { |
| 24 scoped_refptr<extensions::Extension> extension( | 19 scoped_refptr<extensions::Extension> extension( |
| 25 LoadAndExpectSuccess("normalize_icon_paths.json")); | 20 LoadAndExpectSuccess("normalize_icon_paths.json")); |
| 26 const ExtensionIconSet& icons = IconsInfo::GetIcons(extension); | 21 const ExtensionIconSet& icons = IconsInfo::GetIcons(extension); |
| 27 | 22 |
| 28 EXPECT_EQ("16.png", icons.Get(extension_misc::EXTENSION_ICON_BITTY, | 23 EXPECT_EQ("16.png", icons.Get(extension_misc::EXTENSION_ICON_BITTY, |
| 29 ExtensionIconSet::MATCH_EXACTLY)); | 24 ExtensionIconSet::MATCH_EXACTLY)); |
| 30 EXPECT_EQ("48.png", icons.Get(extension_misc::EXTENSION_ICON_MEDIUM, | 25 EXPECT_EQ("48.png", icons.Get(extension_misc::EXTENSION_ICON_MEDIUM, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 53 ExtensionIconSet::MATCH_EXACTLY)); | 48 ExtensionIconSet::MATCH_EXACTLY)); |
| 54 EXPECT_EQ("128.png", icons.Get(extension_misc::EXTENSION_ICON_LARGE, | 49 EXPECT_EQ("128.png", icons.Get(extension_misc::EXTENSION_ICON_LARGE, |
| 55 ExtensionIconSet::MATCH_EXACTLY)); | 50 ExtensionIconSet::MATCH_EXACTLY)); |
| 56 EXPECT_EQ("256.png", icons.Get(extension_misc::EXTENSION_ICON_EXTRA_LARGE, | 51 EXPECT_EQ("256.png", icons.Get(extension_misc::EXTENSION_ICON_EXTRA_LARGE, |
| 57 ExtensionIconSet::MATCH_EXACTLY)); | 52 ExtensionIconSet::MATCH_EXACTLY)); |
| 58 EXPECT_EQ("512.png", icons.Get(extension_misc::EXTENSION_ICON_GIGANTOR, | 53 EXPECT_EQ("512.png", icons.Get(extension_misc::EXTENSION_ICON_GIGANTOR, |
| 59 ExtensionIconSet::MATCH_EXACTLY)); | 54 ExtensionIconSet::MATCH_EXACTLY)); |
| 60 } | 55 } |
| 61 | 56 |
| 62 } // namespace extensions | 57 } // namespace extensions |
| OLD | NEW |