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

Unified Diff: extensions/common/features/complex_feature_unittest.cc

Issue 2116293003: extensions: Generate hash of extension ID at a higher level Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 bff752dd8549a7fea88840bd04d8c2a6b06b77d0..07e0663fbd62bdc79cbf30a299cc948acd3a40ba 100644
--- a/extensions/common/features/complex_feature_unittest.cc
+++ b/extensions/common/features/complex_feature_unittest.cc
@@ -44,38 +44,34 @@ TEST(ComplexFeatureTest, MultipleRulesWhitelist) {
new ComplexFeature(std::move(features)));
// Test match 1st rule.
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature->IsAvailableToManifest(kIdFoo,
- Manifest::TYPE_EXTENSION,
- Manifest::INVALID_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ kIdFoo, Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
// Test match 2nd rule.
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature->IsAvailableToManifest(kIdBar,
- Manifest::TYPE_LEGACY_PACKAGED_APP,
- Manifest::INVALID_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ kIdBar, Manifest::TYPE_LEGACY_PACKAGED_APP,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
// Test whitelist with wrong extension type.
- 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());
+ EXPECT_NE(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ kIdBar, Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
+ EXPECT_NE(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ kIdFoo, Manifest::TYPE_LEGACY_PACKAGED_APP,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
}
// Tests that dependencies are correctly checked.
@@ -106,31 +102,28 @@ TEST(ComplexFeatureTest, Dependencies) {
new ComplexFeature(std::move(features)));
// Available to extensions because of the content_security_policy rule.
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature->IsAvailableToManifest("extensionid",
- Manifest::TYPE_EXTENSION,
- Manifest::INVALID_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ "extensionid", Manifest::TYPE_EXTENSION,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
// Available to platform apps because of the serial rule.
- EXPECT_EQ(
- Feature::IS_AVAILABLE,
- feature->IsAvailableToManifest("platformappid",
- Manifest::TYPE_PLATFORM_APP,
- Manifest::INVALID_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(Feature::IS_AVAILABLE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ "platformappid", Manifest::TYPE_PLATFORM_APP,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
// Not available to hosted apps.
- EXPECT_EQ(
- Feature::INVALID_TYPE,
- feature->IsAvailableToManifest("hostedappid",
- Manifest::TYPE_HOSTED_APP,
- Manifest::INVALID_LOCATION,
- Feature::UNSPECIFIED_PLATFORM,
- Feature::GetCurrentPlatform()).result());
+ EXPECT_EQ(Feature::INVALID_TYPE,
+ feature
+ ->Feature::IsAvailableToManifest(
+ "hostedappid", Manifest::TYPE_HOSTED_APP,
+ Manifest::INVALID_LOCATION, Feature::UNSPECIFIED_PLATFORM)
+ .result());
}
} // namespace extensions
« 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