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/manifest.h" | 5 #include "chrome/common/extensions/manifest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 std::string error; | 173 std::string error; |
174 std::vector<InstallWarning> warnings; | 174 std::vector<InstallWarning> warnings; |
175 manifest->ValidateManifest(&error, &warnings); | 175 manifest->ValidateManifest(&error, &warnings); |
176 EXPECT_TRUE(error.empty()); | 176 EXPECT_TRUE(error.empty()); |
177 EXPECT_TRUE(warnings.empty()); | 177 EXPECT_TRUE(warnings.empty()); |
178 | 178 |
179 // Platform apps cannot have a "page_action" key. | 179 // Platform apps cannot have a "page_action" key. |
180 MutateManifest( | 180 MutateManifest( |
181 &manifest, keys::kPageAction, new DictionaryValue()); | 181 &manifest, keys::kPageAction, new DictionaryValue()); |
182 AssertType(manifest.get(), Manifest::TYPE_EXTENSION); | 182 AssertType(manifest.get(), Manifest::TYPE_EXTENSION); |
183 base::Value* output = NULL; | 183 const base::Value* output = NULL; |
184 EXPECT_TRUE(manifest->HasKey(keys::kPageAction)); | 184 EXPECT_TRUE(manifest->HasKey(keys::kPageAction)); |
185 EXPECT_TRUE(manifest->Get(keys::kPageAction, &output)); | 185 EXPECT_TRUE(manifest->Get(keys::kPageAction, &output)); |
186 | 186 |
187 MutateManifest( | 187 MutateManifest( |
188 &manifest, keys::kPlatformAppBackground, new DictionaryValue()); | 188 &manifest, keys::kPlatformAppBackground, new DictionaryValue()); |
189 AssertType(manifest.get(), Manifest::TYPE_PLATFORM_APP); | 189 AssertType(manifest.get(), Manifest::TYPE_PLATFORM_APP); |
190 EXPECT_FALSE(manifest->HasKey(keys::kPageAction)); | 190 EXPECT_FALSE(manifest->HasKey(keys::kPageAction)); |
191 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output)); | 191 EXPECT_FALSE(manifest->Get(keys::kPageAction, &output)); |
192 MutateManifest( | 192 MutateManifest( |
193 &manifest, keys::kPlatformAppBackground, NULL); | 193 &manifest, keys::kPlatformAppBackground, NULL); |
(...skipping 10 matching lines...) Expand all Loading... |
204 EXPECT_FALSE(manifest->Get(keys::kCommands, &output)); | 204 EXPECT_FALSE(manifest->Get(keys::kCommands, &output)); |
205 | 205 |
206 MutateManifest( | 206 MutateManifest( |
207 &manifest, keys::kManifestVersion, Value::CreateIntegerValue(2)); | 207 &manifest, keys::kManifestVersion, Value::CreateIntegerValue(2)); |
208 EXPECT_TRUE(manifest->HasKey(keys::kCommands)); | 208 EXPECT_TRUE(manifest->HasKey(keys::kCommands)); |
209 EXPECT_TRUE(manifest->Get(keys::kCommands, &output)); | 209 EXPECT_TRUE(manifest->Get(keys::kCommands, &output)); |
210 } | 210 } |
211 }; | 211 }; |
212 | 212 |
213 } // namespace extensions | 213 } // namespace extensions |
OLD | NEW |