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