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

Side by Side Diff: extensions/common/features/base_feature_provider_unittest.cc

Issue 241673002: Support a "policy" extension location in extension features files. At the same (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: format Created 6 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/common/features/base_feature_provider.h" 5 #include "extensions/common/features/base_feature_provider.h"
6 6
7 #include "chrome/common/extensions/features/chrome_channel_feature_filter.h" 7 #include "chrome/common/extensions/features/chrome_channel_feature_filter.h"
8 #include "chrome/common/extensions/features/feature_channel.h" 8 #include "chrome/common/extensions/features/feature_channel.h"
9 #include "extensions/common/features/permission_feature.h" 9 #include "extensions/common/features/permission_feature.h"
10 #include "extensions/common/value_builder.h" 10 #include "extensions/common/value_builder.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 scoped_ptr<BaseFeatureProvider> provider( 164 scoped_ptr<BaseFeatureProvider> provider(
165 new BaseFeatureProvider(*rule, NULL)); 165 new BaseFeatureProvider(*rule, NULL));
166 166
167 Feature* feature = provider->GetFeature("feature1"); 167 Feature* feature = provider->GetFeature("feature1");
168 EXPECT_TRUE(feature); 168 EXPECT_TRUE(feature);
169 169
170 // Make sure both rules are applied correctly. 170 // Make sure both rules are applied correctly.
171 { 171 {
172 ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_BETA); 172 ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_BETA);
173 EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest( 173 EXPECT_EQ(
174 "1", 174 Feature::IS_AVAILABLE,
175 Manifest::TYPE_EXTENSION, 175 feature->IsAvailableToManifest("1",
176 Feature::UNSPECIFIED_LOCATION, 176 Manifest::TYPE_EXTENSION,
177 Feature::UNSPECIFIED_PLATFORM).result()); 177 Manifest::INVALID_LOCATION,
178 EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest( 178 Feature::UNSPECIFIED_PLATFORM).result());
179 "2", 179 EXPECT_EQ(
180 Manifest::TYPE_LEGACY_PACKAGED_APP, 180 Feature::IS_AVAILABLE,
181 Feature::UNSPECIFIED_LOCATION, 181 feature->IsAvailableToManifest("2",
182 Feature::UNSPECIFIED_PLATFORM).result()); 182 Manifest::TYPE_LEGACY_PACKAGED_APP,
183 Manifest::INVALID_LOCATION,
184 Feature::UNSPECIFIED_PLATFORM).result());
183 } 185 }
184 { 186 {
185 ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_STABLE); 187 ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_STABLE);
186 EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest( 188 EXPECT_NE(
187 "1", 189 Feature::IS_AVAILABLE,
188 Manifest::TYPE_EXTENSION, 190 feature->IsAvailableToManifest("1",
189 Feature::UNSPECIFIED_LOCATION, 191 Manifest::TYPE_EXTENSION,
190 Feature::UNSPECIFIED_PLATFORM).result()); 192 Manifest::INVALID_LOCATION,
191 EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest( 193 Feature::UNSPECIFIED_PLATFORM).result());
192 "2", 194 EXPECT_NE(
193 Manifest::TYPE_LEGACY_PACKAGED_APP, 195 Feature::IS_AVAILABLE,
194 Feature::UNSPECIFIED_LOCATION, 196 feature->IsAvailableToManifest("2",
195 Feature::UNSPECIFIED_PLATFORM).result()); 197 Manifest::TYPE_LEGACY_PACKAGED_APP,
198 Manifest::INVALID_LOCATION,
199 Feature::UNSPECIFIED_PLATFORM).result());
196 } 200 }
197 } 201 }
198 202
199 } // namespace extensions 203 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/chrome_channel_feature_filter.cc ('k') | extensions/common/features/complex_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698