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