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

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

Powered by Google App Engine
This is Rietveld 408576698