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

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

Issue 115974: The extensions service wasn't getting inited despite being used by themes (th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 17327)
+++ chrome/browser/extensions/extensions_service_unittest.cc (working copy)
@@ -129,6 +129,18 @@
void TestInstallExtension(const FilePath& path,
bool should_succeed) {
+ InstallExtension(path, should_succeed, false);
+ }
+
+ void TestInstallTheme(const FilePath& path,
+ bool should_succeed) {
+ InstallExtension(path, should_succeed, true);
+ }
+
+ protected:
+ void InstallExtension(const FilePath& path,
+ bool should_succeed,
+ bool is_theme) {
ASSERT_TRUE(file_util::PathExists(path));
service_->InstallExtension(path);
loop_.RunAllPending();
@@ -137,7 +149,13 @@
++total_successes_;
EXPECT_TRUE(installed_) << path.value();
- EXPECT_EQ(1u, loaded_.size()) << path.value();
+
+ // Themes aren't loaded.
+ if (is_theme)
+ EXPECT_EQ(0u, loaded_.size()) << path.value();
+ else
+ EXPECT_EQ(1u, loaded_.size()) << path.value();
+
EXPECT_EQ(0u, errors.size()) << path.value();
EXPECT_EQ(total_successes_, service_->extensions()->size()) <<
path.value();
@@ -159,7 +177,6 @@
ExtensionErrorReporter::GetInstance()->ClearErrors();
}
- protected:
scoped_ptr<TestingProfile> profile_;
scoped_refptr<ExtensionsService> service_;
size_t total_successes_;
@@ -355,17 +372,17 @@
// A theme.
FilePath path = extensions_path.AppendASCII("theme.crx");
- TestInstallExtension(path, true);
+ TestInstallTheme(path, true);
// A theme when extensions are disabled.
SetExtensionsEnabled(false);
path = extensions_path.AppendASCII("theme2.crx");
- TestInstallExtension(path, true);
+ TestInstallTheme(path, true);
SetExtensionsEnabled(true);
// A theme with extension elements.
path = extensions_path.AppendASCII("theme_with_extension.crx");
- TestInstallExtension(path, false);
+ TestInstallTheme(path, false);
}
// Test that when an extension version is reinstalled, nothing happens.

Powered by Google App Engine
This is Rietveld 408576698