| 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/browser_action_handler.h
" | 6 #include "chrome/common/extensions/api/extension_action/browser_action_handler.h
" |
| 7 #include "chrome/common/extensions/extension_builder.h" | 7 #include "chrome/common/extensions/extension_builder.h" |
| 8 #include "chrome/common/extensions/extension_icon_set.h" | 8 #include "chrome/common/extensions/extension_icon_set.h" |
| 9 #include "chrome/common/extensions/extension_manifest_constants.h" | 9 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 10 #include "chrome/common/extensions/manifest_handler.h" | |
| 11 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 10 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 12 #include "chrome/common/extensions/value_builder.h" | 11 #include "chrome/common/extensions/value_builder.h" |
| 13 #include "extensions/common/error_utils.h" | 12 #include "extensions/common/error_utils.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 16 namespace errors = extension_manifest_errors; | 15 namespace errors = extension_manifest_errors; |
| 17 | 16 |
| 18 namespace extensions { | 17 namespace extensions { |
| 19 namespace { | 18 namespace { |
| 20 | 19 |
| 21 class BrowserActionManifestTest : public ExtensionManifestTest { | 20 class BrowserActionManifestTest : public ExtensionManifestTest { |
| 22 protected: | 21 protected: |
| 23 virtual void SetUp() OVERRIDE { | 22 virtual void SetUp() OVERRIDE { |
| 24 ExtensionManifestTest::SetUp(); | 23 ExtensionManifestTest::SetUp(); |
| 25 ManifestHandler::Register(extension_manifest_keys::kBrowserAction, | 24 (new BrowserActionHandler)->Register(); |
| 26 make_linked_ptr(new BrowserActionHandler)); | |
| 27 } | 25 } |
| 28 }; | 26 }; |
| 29 | 27 |
| 30 TEST_F(BrowserActionManifestTest, | 28 TEST_F(BrowserActionManifestTest, |
| 31 BrowserActionManifestIcons_NoDefaultIcons) { | 29 BrowserActionManifestIcons_NoDefaultIcons) { |
| 32 scoped_refptr<const Extension> extension = | 30 scoped_refptr<const Extension> extension = |
| 33 ExtensionBuilder() | 31 ExtensionBuilder() |
| 34 .SetManifest(DictionaryBuilder() | 32 .SetManifest(DictionaryBuilder() |
| 35 .Set("name", "No default properties") | 33 .Set("name", "No default properties") |
| 36 .Set("version", "1.0.0") | 34 .Set("version", "1.0.0") |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 .Build(); | 111 .Build(); |
| 114 | 112 |
| 115 string16 error = ErrorUtils::FormatErrorMessageUTF16( | 113 string16 error = ErrorUtils::FormatErrorMessageUTF16( |
| 116 errors::kInvalidIconPath, "19"); | 114 errors::kInvalidIconPath, "19"); |
| 117 LoadAndExpectError(Manifest(manifest_value.get(), "Invalid default icon"), | 115 LoadAndExpectError(Manifest(manifest_value.get(), "Invalid default icon"), |
| 118 errors::kInvalidIconPath); | 116 errors::kInvalidIconPath); |
| 119 } | 117 } |
| 120 | 118 |
| 121 } // namespace | 119 } // namespace |
| 122 } // namespace extensions | 120 } // namespace extensions |
| OLD | NEW |