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/chrome_manifest_test.h" | 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
7 #include "extensions/common/constants.h" | 7 #include "extensions/common/constants.h" |
8 #include "extensions/common/error_utils.h" | 8 #include "extensions/common/error_utils.h" |
9 #include "extensions/common/extension_builder.h" | 9 #include "extensions/common/extension_builder.h" |
10 #include "extensions/common/extension_icon_set.h" | 10 #include "extensions/common/extension_icon_set.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DictionaryBuilder() | 74 DictionaryBuilder() |
75 .Set("name", "Dictionary default icon") | 75 .Set("name", "Dictionary default icon") |
76 .Set("version", "1.0.0") | 76 .Set("version", "1.0.0") |
77 .Set("manifest_version", 2) | 77 .Set("manifest_version", 2) |
78 .Set("browser_action", | 78 .Set("browser_action", |
79 DictionaryBuilder().Set("default_icon", | 79 DictionaryBuilder().Set("default_icon", |
80 DictionaryBuilder() | 80 DictionaryBuilder() |
81 .Set("19", "icon19.png") | 81 .Set("19", "icon19.png") |
82 .Set("24", "icon24.png") | 82 .Set("24", "icon24.png") |
83 .Set("38", "icon38.png")))) | 83 .Set("38", "icon38.png")))) |
| 84 // Don't check for existence of icons during parsing. |
| 85 .SetLocation(Manifest::UNPACKED) |
84 .Build(); | 86 .Build(); |
85 | 87 |
86 ASSERT_TRUE(extension.get()); | 88 ASSERT_TRUE(extension.get()); |
87 const ActionInfo* browser_action_info = | 89 const ActionInfo* browser_action_info = |
88 ActionInfo::GetBrowserActionInfo(extension.get()); | 90 ActionInfo::GetBrowserActionInfo(extension.get()); |
89 ASSERT_TRUE(browser_action_info); | 91 ASSERT_TRUE(browser_action_info); |
90 ASSERT_FALSE(browser_action_info->default_icon.empty()); | 92 ASSERT_FALSE(browser_action_info->default_icon.empty()); |
91 | 93 |
92 const ExtensionIconSet& icons = browser_action_info->default_icon; | 94 const ExtensionIconSet& icons = browser_action_info->default_icon; |
93 | 95 |
(...skipping 17 matching lines...) Expand all Loading... |
111 | 113 |
112 base::string16 error = ErrorUtils::FormatErrorMessageUTF16( | 114 base::string16 error = ErrorUtils::FormatErrorMessageUTF16( |
113 errors::kInvalidIconPath, "19"); | 115 errors::kInvalidIconPath, "19"); |
114 LoadAndExpectError( | 116 LoadAndExpectError( |
115 ManifestData(manifest_value.Pass(), "Invalid default icon"), | 117 ManifestData(manifest_value.Pass(), "Invalid default icon"), |
116 errors::kInvalidIconPath); | 118 errors::kInvalidIconPath); |
117 } | 119 } |
118 | 120 |
119 } // namespace | 121 } // namespace |
120 } // namespace extensions | 122 } // namespace extensions |
OLD | NEW |