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

Unified Diff: extensions/common/features/complex_feature_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/features/complex_feature.cc ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/features/complex_feature_unittest.cc
diff --git a/extensions/common/features/complex_feature_unittest.cc b/extensions/common/features/complex_feature_unittest.cc
index 128ab9585e4126648f45e92b871f0595b4f6b299..0c3f2d3f2753b81f7fd11dedc454ad9584dbf2d5 100644
--- a/extensions/common/features/complex_feature_unittest.cc
+++ b/extensions/common/features/complex_feature_unittest.cc
@@ -70,33 +70,38 @@ TEST_F(ExtensionComplexFeatureTest, MultipleRulesWhitelist) {
scoped_ptr<ComplexFeature> feature(new ComplexFeature(features.Pass()));
// Test match 1st rule.
- EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- kIdFoo,
- Manifest::TYPE_EXTENSION,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest(kIdFoo,
+ Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
// Test match 2nd rule.
- EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- kIdBar,
- Manifest::TYPE_LEGACY_PACKAGED_APP,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest(kIdBar,
+ Manifest::TYPE_LEGACY_PACKAGED_APP,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
// Test whitelist with wrong extension type.
- EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- kIdBar,
- Manifest::TYPE_EXTENSION,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
- EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(kIdFoo,
- Manifest::TYPE_LEGACY_PACKAGED_APP,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_NE(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest(kIdBar,
+ Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
+ EXPECT_NE(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest(kIdFoo,
+ Manifest::TYPE_LEGACY_PACKAGED_APP,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
}
TEST_F(ExtensionComplexFeatureTest, MultipleRulesChannels) {
@@ -126,34 +131,37 @@ TEST_F(ExtensionComplexFeatureTest, MultipleRulesChannels) {
// Test match 1st rule.
{
ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_UNKNOWN);
- EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- "1",
- Manifest::TYPE_EXTENSION,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest("1",
+ Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
}
// Test match 2nd rule.
{
ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_BETA);
- EXPECT_EQ(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- "2",
- Manifest::TYPE_LEGACY_PACKAGED_APP,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest("2",
+ Manifest::TYPE_LEGACY_PACKAGED_APP,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
}
// Test feature not available to extensions above channel unknown.
{
ScopedCurrentChannel current_channel(VersionInfo::CHANNEL_BETA);
- EXPECT_NE(Feature::IS_AVAILABLE, feature->IsAvailableToManifest(
- "1",
- Manifest::TYPE_EXTENSION,
- Feature::UNSPECIFIED_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_NE(
+ Feature::IS_AVAILABLE,
+ feature->IsAvailableToManifest("1",
+ Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION,
+ Feature::UNSPECIFIED_PLATFORM,
+ Feature::GetCurrentPlatform()).result());
}
}
« no previous file with comments | « extensions/common/features/complex_feature.cc ('k') | extensions/common/features/feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698