| 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/manifest_tests/extension_manifest_test.h" | 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
| 7 #include "extensions/common/error_utils.h" | 7 #include "extensions/common/error_utils.h" |
| 8 #include "extensions/common/extension_builder.h" | 8 #include "extensions/common/extension_builder.h" |
| 9 #include "extensions/common/extension_icon_set.h" | 9 #include "extensions/common/extension_icon_set.h" |
| 10 #include "extensions/common/manifest_constants.h" | 10 #include "extensions/common/manifest_constants.h" |
| 11 #include "extensions/common/value_builder.h" | 11 #include "extensions/common/value_builder.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 namespace errors = manifest_errors; | 16 namespace errors = manifest_errors; |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class BrowserActionManifestTest : public ExtensionManifestTest { | 20 class BrowserActionManifestTest : public ChromeManifestTest { |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 TEST_F(BrowserActionManifestTest, | 23 TEST_F(BrowserActionManifestTest, |
| 24 BrowserActionManifestIcons_NoDefaultIcons) { | 24 BrowserActionManifestIcons_NoDefaultIcons) { |
| 25 scoped_refptr<const Extension> extension = | 25 scoped_refptr<const Extension> extension = |
| 26 ExtensionBuilder() | 26 ExtensionBuilder() |
| 27 .SetManifest(DictionaryBuilder() | 27 .SetManifest(DictionaryBuilder() |
| 28 .Set("name", "No default properties") | 28 .Set("name", "No default properties") |
| 29 .Set("version", "1.0.0") | 29 .Set("version", "1.0.0") |
| 30 .Set("manifest_version", 2) | 30 .Set("manifest_version", 2) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 .Set("name", "Invalid default icon").Set("version", "1.0.0") | 98 .Set("name", "Invalid default icon").Set("version", "1.0.0") |
| 99 .Set("manifest_version", 2) | 99 .Set("manifest_version", 2) |
| 100 .Set("browser_action", | 100 .Set("browser_action", |
| 101 DictionaryBuilder().Set( | 101 DictionaryBuilder().Set( |
| 102 "default_icon", | 102 "default_icon", |
| 103 DictionaryBuilder().Set("19", std::string()) // Invalid value. | 103 DictionaryBuilder().Set("19", std::string()) // Invalid value. |
| 104 .Set("24", "icon24.png").Set("38", "icon38.png"))).Build(); | 104 .Set("24", "icon24.png").Set("38", "icon38.png"))).Build(); |
| 105 | 105 |
| 106 base::string16 error = ErrorUtils::FormatErrorMessageUTF16( | 106 base::string16 error = ErrorUtils::FormatErrorMessageUTF16( |
| 107 errors::kInvalidIconPath, "19"); | 107 errors::kInvalidIconPath, "19"); |
| 108 LoadAndExpectError(Manifest(manifest_value.get(), "Invalid default icon"), | 108 LoadAndExpectError(ManifestData(manifest_value.get(), "Invalid default icon"), |
| 109 errors::kInvalidIconPath); | 109 errors::kInvalidIconPath); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace | 112 } // namespace |
| 113 } // namespace extensions | 113 } // namespace extensions |
| OLD | NEW |