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

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

Issue 3063002: Merge 53127 - Added checks to handle unsyncable extensions.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: 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
===================================================================
--- chrome/browser/extensions/extensions_service_unittest.cc (revision 53365)
+++ chrome/browser/extensions/extensions_service_unittest.cc (working copy)
@@ -1281,6 +1281,29 @@
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 @@
// 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