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

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

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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
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/simple_feature_provider.h" 5 #include "chrome/common/extensions/simple_feature_provider.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using extensions::Extension;
9 using extensions::Feature; 10 using extensions::Feature;
10 using extensions::SimpleFeatureProvider; 11 using extensions::SimpleFeatureProvider;
11 12
12 TEST(SimpleFeatureProvider, ManifestFeatures) { 13 TEST(SimpleFeatureProvider, ManifestFeatures) {
13 SimpleFeatureProvider* provider = 14 SimpleFeatureProvider* provider =
14 SimpleFeatureProvider::GetManifestFeatures(); 15 SimpleFeatureProvider::GetManifestFeatures();
15 Feature* feature = provider->GetFeature("description"); 16 Feature* feature = provider->GetFeature("description");
16 ASSERT_TRUE(feature); 17 ASSERT_TRUE(feature);
17 EXPECT_EQ(5u, feature->extension_types()->size()); 18 EXPECT_EQ(5u, feature->extension_types()->size());
18 EXPECT_EQ(1u, feature->extension_types()->count(Extension::TYPE_EXTENSION)); 19 EXPECT_EQ(1u, feature->extension_types()->count(Extension::TYPE_EXTENSION));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 EXPECT_TRUE(provider->GetFeature("feature1")); 115 EXPECT_TRUE(provider->GetFeature("feature1"));
115 116
116 // feature2 won't validate because of the presence of "contexts". 117 // feature2 won't validate because of the presence of "contexts".
117 EXPECT_FALSE(provider->GetFeature("feature2")); 118 EXPECT_FALSE(provider->GetFeature("feature2"));
118 119
119 // If we remove it, it works. 120 // If we remove it, it works.
120 feature2->Remove("contexts", NULL); 121 feature2->Remove("contexts", NULL);
121 provider.reset(new SimpleFeatureProvider(value.get(), NULL)); 122 provider.reset(new SimpleFeatureProvider(value.get(), NULL));
122 EXPECT_TRUE(provider->GetFeature("feature2")); 123 EXPECT_TRUE(provider->GetFeature("feature2"));
123 } 124 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698