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

Unified Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 2884027: Added checks to handle unsyncable extensions. (Closed)
Patch Set: Fixed comment typo Created 10 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
Index: chrome/browser/extensions/extensions_service_unittest.cc
diff --git a/chrome/browser/extensions/extensions_service_unittest.cc b/chrome/browser/extensions/extensions_service_unittest.cc
index 1d1406f225c2e61a9f8f0beae89691e6f615a52b..c209f591ce504c7794dff116dac7df370c19e37e 100644
--- a/chrome/browser/extensions/extensions_service_unittest.cc
+++ b/chrome/browser/extensions/extensions_service_unittest.cc
@@ -1281,6 +1281,29 @@ TEST_F(ExtensionsServiceTest, UpdatePendingExtension) {
service_->IsIncognitoEnabled(extension));
}
+// Test updating a pending theme.
+TEST_F(ExtensionsServiceTest, UpdatePendingTheme) {
+ InitializeEmptyExtensionsService();
+ service_->AddPendingExtension(
+ theme_crx, GURL(), true, false, Extension::ENABLED, false);
+ EXPECT_TRUE(ContainsKey(service_->pending_extensions(), theme_crx));
+
+ FilePath extensions_path;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &extensions_path));
+ extensions_path = extensions_path.AppendASCII("extensions");
+ FilePath path = extensions_path.AppendASCII("theme.crx");
+ UpdateExtension(theme_crx, path, ENABLED);
+
+ EXPECT_FALSE(ContainsKey(service_->pending_extensions(), theme_crx));
+
+ Extension* extension = service_->GetExtensionById(theme_crx, true);
+ ASSERT_TRUE(extension);
+
+ EXPECT_EQ(Extension::ENABLED,
+ service_->extension_prefs()->GetExtensionState(extension->id()));
+ EXPECT_FALSE(service_->IsIncognitoEnabled(extension));
+}
+
// TODO(akalin): Test updating a pending extension non-silently once
// we can mock out ExtensionInstallUI and inject our version into
// UpdateExtension().
@@ -1304,9 +1327,12 @@ TEST_F(ExtensionsServiceTest, UpdatePendingExtensionWrongIsTheme) {
// TODO(akalin): Figure out how to check that the extensions
// directory is cleaned up properly in OnExtensionInstalled().
- EXPECT_TRUE(ContainsKey(service_->pending_extensions(), kGoodId));
+ EXPECT_FALSE(ContainsKey(service_->pending_extensions(), kGoodId));
}
+// TODO(akalin): Figure out how to test that installs of pending
+// unsyncable extensions are blocked.
+
// Test updating a pending extension for one that is not pending.
TEST_F(ExtensionsServiceTest, UpdatePendingExtensionNotPending) {
InitializeEmptyExtensionsService();
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | chrome/browser/sync/glue/extension_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698