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

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

Issue 128223003: Add unit tests to ensure that certain types of extensions are not disabled by Profile Reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f85a0806af5d138b181ba85ea36cde9d1742cb6..08f204a32af8b9856fee25fda3e37de0a9771068 100644
--- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc
+++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc
@@ -477,7 +477,7 @@ TEST_F(ProfileResetterTest, ResetExtensionsByDisabling) {
extensions::Manifest::TYPE_EXTENSION,
false);
service_->AddExtension(ext2.get());
- // Components and external policy extensions shouldn't be deleted.
+ // Component extensions and policy-managed extensions shouldn't be disabled.
scoped_refptr<Extension> ext3 = CreateExtension(
ASCIIToUTF16("example3"),
base::FilePath(FILE_PATH_LITERAL("//nonexistent2")),
@@ -485,21 +485,37 @@ TEST_F(ProfileResetterTest, ResetExtensionsByDisabling) {
extensions::Manifest::TYPE_EXTENSION,
false);
service_->AddExtension(ext3.get());
- scoped_refptr<Extension> ext4 =
- CreateExtension(ASCIIToUTF16("example4"),
- base::FilePath(FILE_PATH_LITERAL("//nonexistent3")),
- Manifest::EXTERNAL_POLICY_DOWNLOAD,
- extensions::Manifest::TYPE_EXTENSION,
- false);
+ scoped_refptr<Extension> ext4 = CreateExtension(
+ ASCIIToUTF16("example4"),
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent3")),
+ Manifest::EXTERNAL_POLICY_DOWNLOAD,
+ extensions::Manifest::TYPE_EXTENSION,
+ false);
service_->AddExtension(ext4.get());
- EXPECT_EQ(4u, service_->extensions()->size());
+ scoped_refptr<Extension> ext5 = CreateExtension(
+ ASCIIToUTF16("example5"),
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent4")),
+ Manifest::EXTERNAL_COMPONENT,
+ extensions::Manifest::TYPE_EXTENSION,
+ false);
+ service_->AddExtension(ext5.get());
+ scoped_refptr<Extension> ext6 = CreateExtension(
+ ASCIIToUTF16("example6"),
+ base::FilePath(FILE_PATH_LITERAL("//nonexistent5")),
+ Manifest::EXTERNAL_POLICY,
+ extensions::Manifest::TYPE_EXTENSION,
+ false);
+ service_->AddExtension(ext6.get());
+ EXPECT_EQ(6u, service_->extensions()->size());
ResetAndWait(ProfileResetter::EXTENSIONS);
- EXPECT_EQ(2u, service_->extensions()->size());
+ EXPECT_EQ(4u, service_->extensions()->size());
EXPECT_FALSE(service_->extensions()->Contains(theme->id()));
EXPECT_FALSE(service_->extensions()->Contains(ext2->id()));
EXPECT_TRUE(service_->extensions()->Contains(ext3->id()));
EXPECT_TRUE(service_->extensions()->Contains(ext4->id()));
+ EXPECT_TRUE(service_->extensions()->Contains(ext5->id()));
+ EXPECT_TRUE(service_->extensions()->Contains(ext6->id()));
EXPECT_TRUE(theme_service->UsingDefaultTheme());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698