| 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 "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 6 | 6 |
| 7 #include "base/memory/linked_ptr.h" | 7 #include "base/memory/linked_ptr.h" |
| 8 #include "chrome/common/extensions/api/icons/icons_handler.h" | 8 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
| 10 #include "chrome/common/extensions/extension_constants.h" | 10 #include "chrome/common/extensions/extension_constants.h" |
| 11 #include "chrome/common/extensions/extension_icon_set.h" | 11 #include "chrome/common/extensions/extension_icon_set.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class IconsManifestTest : public ExtensionManifestTest { | 16 class IconsManifestTest : public ExtensionManifestTest { |
| 17 protected: | 17 protected: |
| 18 virtual void SetUp() OVERRIDE { | 18 virtual void SetUp() OVERRIDE { |
| 19 ExtensionManifestTest::SetUp(); | 19 ExtensionManifestTest::SetUp(); |
| 20 ManifestHandler::Register(extension_manifest_keys::kIcons, | 20 (new IconsHandler)->Register(); |
| 21 make_linked_ptr(new IconsHandler)); | |
| 22 } | 21 } |
| 23 }; | 22 }; |
| 24 | 23 |
| 25 TEST_F(IconsManifestTest, NormalizeIconPaths) { | 24 TEST_F(IconsManifestTest, NormalizeIconPaths) { |
| 26 scoped_refptr<extensions::Extension> extension( | 25 scoped_refptr<extensions::Extension> extension( |
| 27 LoadAndExpectSuccess("normalize_icon_paths.json")); | 26 LoadAndExpectSuccess("normalize_icon_paths.json")); |
| 28 const ExtensionIconSet& icons = IconsInfo::GetIcons(extension); | 27 const ExtensionIconSet& icons = IconsInfo::GetIcons(extension); |
| 29 | 28 |
| 30 EXPECT_EQ("16.png", icons.Get(extension_misc::EXTENSION_ICON_BITTY, | 29 EXPECT_EQ("16.png", icons.Get(extension_misc::EXTENSION_ICON_BITTY, |
| 31 ExtensionIconSet::MATCH_EXACTLY)); | 30 ExtensionIconSet::MATCH_EXACTLY)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 ExtensionIconSet::MATCH_EXACTLY)); | 54 ExtensionIconSet::MATCH_EXACTLY)); |
| 56 EXPECT_EQ("128.png", icons.Get(extension_misc::EXTENSION_ICON_LARGE, | 55 EXPECT_EQ("128.png", icons.Get(extension_misc::EXTENSION_ICON_LARGE, |
| 57 ExtensionIconSet::MATCH_EXACTLY)); | 56 ExtensionIconSet::MATCH_EXACTLY)); |
| 58 EXPECT_EQ("256.png", icons.Get(extension_misc::EXTENSION_ICON_EXTRA_LARGE, | 57 EXPECT_EQ("256.png", icons.Get(extension_misc::EXTENSION_ICON_EXTRA_LARGE, |
| 59 ExtensionIconSet::MATCH_EXACTLY)); | 58 ExtensionIconSet::MATCH_EXACTLY)); |
| 60 EXPECT_EQ("512.png", icons.Get(extension_misc::EXTENSION_ICON_GIGANTOR, | 59 EXPECT_EQ("512.png", icons.Get(extension_misc::EXTENSION_ICON_GIGANTOR, |
| 61 ExtensionIconSet::MATCH_EXACTLY)); | 60 ExtensionIconSet::MATCH_EXACTLY)); |
| 62 } | 61 } |
| 63 | 62 |
| 64 } // namespace extensions | 63 } // namespace extensions |
| OLD | NEW |