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

Side by Side Diff: chrome/common/extensions/features/feature_unittest.cc

Issue 10782030: Add content pack information to Extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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/features/feature.h" 5 #include "chrome/common/extensions/features/feature.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using chrome::VersionInfo; 9 using chrome::VersionInfo;
10 using extensions::Extension; 10 using extensions::Extension;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 298
299 TEST(ExtensionFeatureTest, ParsePackageTypes) { 299 TEST(ExtensionFeatureTest, ParsePackageTypes) {
300 scoped_ptr<DictionaryValue> value(new DictionaryValue()); 300 scoped_ptr<DictionaryValue> value(new DictionaryValue());
301 ListValue* extension_types = new ListValue(); 301 ListValue* extension_types = new ListValue();
302 extension_types->Append(Value::CreateStringValue("extension")); 302 extension_types->Append(Value::CreateStringValue("extension"));
303 extension_types->Append(Value::CreateStringValue("theme")); 303 extension_types->Append(Value::CreateStringValue("theme"));
304 extension_types->Append(Value::CreateStringValue("packaged_app")); 304 extension_types->Append(Value::CreateStringValue("packaged_app"));
305 extension_types->Append(Value::CreateStringValue("hosted_app")); 305 extension_types->Append(Value::CreateStringValue("hosted_app"));
306 extension_types->Append(Value::CreateStringValue("platform_app")); 306 extension_types->Append(Value::CreateStringValue("platform_app"));
307 extension_types->Append(Value::CreateStringValue("content_pack"));
307 value->Set("extension_types", extension_types); 308 value->Set("extension_types", extension_types);
308 scoped_ptr<Feature> feature(new Feature()); 309 scoped_ptr<Feature> feature(new Feature());
309 feature->Parse(value.get()); 310 feature->Parse(value.get());
310 EXPECT_EQ(5u, feature->extension_types()->size()); 311 EXPECT_EQ(6u, feature->extension_types()->size());
311 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_EXTENSION)); 312 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_EXTENSION));
312 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_THEME)); 313 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_THEME));
313 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_PACKAGED_APP)); 314 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_PACKAGED_APP));
314 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_HOSTED_APP)); 315 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_HOSTED_APP));
315 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_PLATFORM_APP)); 316 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_PLATFORM_APP));
317 EXPECT_TRUE(feature->extension_types()->count(Extension::TYPE_CONTENT_PACK));
316 318
317 value->SetString("extension_types", "all"); 319 value->SetString("extension_types", "all");
318 scoped_ptr<Feature> feature2(new Feature()); 320 scoped_ptr<Feature> feature2(new Feature());
319 feature2->Parse(value.get()); 321 feature2->Parse(value.get());
320 EXPECT_EQ(*(feature->extension_types()), *(feature2->extension_types())); 322 EXPECT_EQ(*(feature->extension_types()), *(feature2->extension_types()));
321 } 323 }
322 324
323 TEST(ExtensionFeatureTest, ParseContexts) { 325 TEST(ExtensionFeatureTest, ParseContexts) {
324 scoped_ptr<DictionaryValue> value(new DictionaryValue()); 326 scoped_ptr<DictionaryValue> value(new DictionaryValue());
325 ListValue* contexts = new ListValue(); 327 ListValue* contexts = new ListValue();
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 IsAvailableInChannel("", VersionInfo::CHANNEL_CANARY)); 540 IsAvailableInChannel("", VersionInfo::CHANNEL_CANARY));
539 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 541 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
540 IsAvailableInChannel("", VersionInfo::CHANNEL_DEV)); 542 IsAvailableInChannel("", VersionInfo::CHANNEL_DEV));
541 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 543 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
542 IsAvailableInChannel("", VersionInfo::CHANNEL_BETA)); 544 IsAvailableInChannel("", VersionInfo::CHANNEL_BETA));
543 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 545 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
544 IsAvailableInChannel("", VersionInfo::CHANNEL_STABLE)); 546 IsAvailableInChannel("", VersionInfo::CHANNEL_STABLE));
545 } 547 }
546 548
547 } // namespace 549 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698