Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: chrome/common/extensions/manifest_unittest.cc

Issue 12253022: Manifest handler for all keys background-related. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698