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

Unified Diff: chrome/browser/profile_resetter/profile_resetter_unittest.cc

Issue 2738553002: [Extensions] Log instances of invalid extensions being added (Closed)
Patch Set: . Created 3 years, 9 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
Index: chrome/browser/profile_resetter/profile_resetter_unittest.cc
diff --git a/chrome/browser/profile_resetter/profile_resetter_unittest.cc b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
index 5bbfd4a6f71934b4e9e165bae1c95813e99d26ba..018ce88d0d37f118334894adf60b044e93ccc1ac 100644
--- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc
+++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
@@ -560,8 +560,8 @@ TEST_F(ProfileResetterTest, ResetExtensionsByDisabling) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
scoped_refptr<Extension> theme = CreateExtension(
- base::ASCIIToUTF16("example1"), temp_dir.GetPath(),
- Manifest::INVALID_LOCATION, extensions::Manifest::TYPE_THEME, false);
+ base::ASCIIToUTF16("example1"), temp_dir.GetPath(), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_THEME, false);
service_->FinishInstallationForTest(theme.get());
// Let ThemeService finish creating the theme pack.
base::RunLoop().RunUntilIdle();
@@ -572,10 +572,8 @@ TEST_F(ProfileResetterTest, ResetExtensionsByDisabling) {
scoped_refptr<Extension> ext2 = CreateExtension(
base::ASCIIToUTF16("example2"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
service_->AddExtension(ext2.get());
// Component extensions and policy-managed extensions shouldn't be disabled.
scoped_refptr<Extension> ext3 = CreateExtension(
@@ -622,18 +620,14 @@ TEST_F(ProfileResetterTest, ResetExtensionsByDisabling) {
TEST_F(ProfileResetterTest, ResetExtensionsByDisablingNonOrganic) {
scoped_refptr<Extension> ext2 = CreateExtension(
base::ASCIIToUTF16("example2"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
service_->AddExtension(ext2.get());
// Components and external policy extensions shouldn't be deleted.
scoped_refptr<Extension> ext3 = CreateExtension(
base::ASCIIToUTF16("example3"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent2")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent2")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
service_->AddExtension(ext3.get());
EXPECT_EQ(2u, registry()->enabled_extensions().size());
@@ -653,8 +647,8 @@ TEST_F(ProfileResetterTest, ResetExtensionsAndDefaultApps) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
scoped_refptr<Extension> ext1 = CreateExtension(
- base::ASCIIToUTF16("example1"), temp_dir.GetPath(),
- Manifest::INVALID_LOCATION, extensions::Manifest::TYPE_THEME, false);
+ base::ASCIIToUTF16("example1"), temp_dir.GetPath(), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_THEME, false);
service_->FinishInstallationForTest(ext1.get());
// Let ThemeService finish creating the theme pack.
base::RunLoop().RunUntilIdle();
@@ -663,20 +657,16 @@ TEST_F(ProfileResetterTest, ResetExtensionsAndDefaultApps) {
ThemeServiceFactory::GetForProfile(profile());
EXPECT_FALSE(theme_service->UsingDefaultTheme());
- scoped_refptr<Extension> ext2 =
- CreateExtension(base::ASCIIToUTF16("example2"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent2")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ scoped_refptr<Extension> ext2 = CreateExtension(
+ base::ASCIIToUTF16("example2"),
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent2")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
service_->AddExtension(ext2.get());
- scoped_refptr<Extension> ext3 =
- CreateExtension(base::ASCIIToUTF16("example2"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent3")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_HOSTED_APP,
- true);
+ scoped_refptr<Extension> ext3 = CreateExtension(
+ base::ASCIIToUTF16("example2"),
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent3")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_HOSTED_APP, true);
service_->AddExtension(ext3.get());
EXPECT_EQ(3u, registry()->enabled_extensions().size());
@@ -849,10 +839,8 @@ TEST_F(ProfileResetterTest, CheckSnapshots) {
scoped_refptr<Extension> ext = CreateExtension(
base::ASCIIToUTF16("example"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
ASSERT_TRUE(ext.get());
service_->AddExtension(ext.get());
@@ -938,10 +926,8 @@ TEST_F(ProfileResetterTest, FeedbackSerializationAsProtoTest) {
scoped_refptr<Extension> ext = CreateExtension(
base::ASCIIToUTF16("example"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
ASSERT_TRUE(ext.get());
service_->AddExtension(ext.get());
@@ -1002,10 +988,8 @@ struct FeedbackCapture {
TEST_F(ProfileResetterTest, GetReadableFeedback) {
scoped_refptr<Extension> ext = CreateExtension(
base::WideToUTF16(L"Tiƫsto"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent")),
- Manifest::INVALID_LOCATION,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent")), Manifest::UNPACKED,
+ extensions::Manifest::TYPE_EXTENSION, false);
ASSERT_TRUE(ext.get());
service_->AddExtension(ext.get());

Powered by Google App Engine
This is Rietveld 408576698