| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/extension_action/action_info.h" | 5 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 6 #include "chrome/common/extensions/api/extension_action/script_badge_handler.h" | 6 #include "chrome/common/extensions/api/extension_action/script_badge_handler.h" |
| 7 #include "chrome/common/extensions/extension_builder.h" | 7 #include "chrome/common/extensions/extension_builder.h" |
| 8 #include "chrome/common/extensions/extension_constants.h" | 8 #include "chrome/common/extensions/extension_constants.h" |
| 9 #include "chrome/common/extensions/extension_icon_set.h" | 9 #include "chrome/common/extensions/extension_icon_set.h" |
| 10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 if (install_warnings[i].message != errors::kScriptBadgeRequiresFlag) | 28 if (install_warnings[i].message != errors::kScriptBadgeRequiresFlag) |
| 29 result.push_back(install_warnings[i]); | 29 result.push_back(install_warnings[i]); |
| 30 } | 30 } |
| 31 return result; | 31 return result; |
| 32 } | 32 } |
| 33 | 33 |
| 34 class ScriptBadgeManifestTest : public ExtensionManifestTest { | 34 class ScriptBadgeManifestTest : public ExtensionManifestTest { |
| 35 protected: | 35 protected: |
| 36 virtual void SetUp() OVERRIDE { | 36 virtual void SetUp() OVERRIDE { |
| 37 ManifestHandler::Register(extension_manifest_keys::kScriptBadge, | 37 ManifestHandler::Register(extension_manifest_keys::kScriptBadge, |
| 38 new ScriptBadgeHandler); | 38 make_linked_ptr(new ScriptBadgeHandler)); |
| 39 } | 39 } |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 TEST_F(ScriptBadgeManifestTest, ScriptBadgeBasic) { | 44 TEST_F(ScriptBadgeManifestTest, ScriptBadgeBasic) { |
| 45 scoped_refptr<Extension> extension( | 45 scoped_refptr<Extension> extension( |
| 46 ExtensionBuilder() | 46 ExtensionBuilder() |
| 47 .SetManifest(DictionaryBuilder() | 47 .SetManifest(DictionaryBuilder() |
| 48 .Set("manifest_version", 2) | 48 .Set("manifest_version", 2) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 EXPECT_EQ(2u, default_icon.map().size()); | 147 EXPECT_EQ(2u, default_icon.map().size()); |
| 148 EXPECT_EQ("icon128.png", | 148 EXPECT_EQ("icon128.png", |
| 149 default_icon.Get(extension_misc::EXTENSION_ICON_BITTY, | 149 default_icon.Get(extension_misc::EXTENSION_ICON_BITTY, |
| 150 ExtensionIconSet::MATCH_EXACTLY)); | 150 ExtensionIconSet::MATCH_EXACTLY)); |
| 151 EXPECT_EQ("icon128.png", | 151 EXPECT_EQ("icon128.png", |
| 152 default_icon.Get(2 * extension_misc::EXTENSION_ICON_BITTY, | 152 default_icon.Get(2 * extension_misc::EXTENSION_ICON_BITTY, |
| 153 ExtensionIconSet::MATCH_EXACTLY)); | 153 ExtensionIconSet::MATCH_EXACTLY)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace extensions | 156 } // namespace extensions |
| OLD | NEW |