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

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

Issue 466012: Don't ping for extension blacklist when no extensions are installed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | chrome/browser/extensions/extension_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_browsertests_misc.cc
===================================================================
--- chrome/browser/extensions/extension_browsertests_misc.cc (revision 33298)
+++ chrome/browser/extensions/extension_browsertests_misc.cc (working copy)
@@ -619,19 +619,23 @@
// Tests that we can uninstall a disabled extension.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, UninstallDisabled) {
// Install and upgrade, so that we have a disabled extension.
+ ExtensionsService* service = browser()->profile()->GetExtensionsService();
+ ASSERT_FALSE(service->HasInstalledExtensions());
ASSERT_TRUE(InstallExtension(
test_data_dir_.AppendASCII("permissions-low-v1.crx"), 1));
+ ASSERT_TRUE(service->HasInstalledExtensions());
ASSERT_TRUE(UpdateExtension("pgdpcfcocojkjfbgpiianjngphoopgmo",
test_data_dir_.AppendASCII("permissions-high-v2.crx"), -1));
- ExtensionsService* service = browser()->profile()->GetExtensionsService();
EXPECT_EQ(0u, service->extensions()->size());
ASSERT_EQ(1u, service->disabled_extensions()->size());
+ ASSERT_TRUE(service->HasInstalledExtensions());
// Now try uninstalling it.
UninstallExtension(service->disabled_extensions()->at(0)->id());
EXPECT_EQ(0u, service->extensions()->size());
EXPECT_EQ(0u, service->disabled_extensions()->size());
+ ASSERT_FALSE(service->HasInstalledExtensions());
}
// Tests that disabling and re-enabling an extension works.
@@ -641,6 +645,7 @@
browser()->profile()->GetExtensionProcessManager();
// Load an extension, expect the toolstrip to be available.
+ ASSERT_FALSE(service->HasInstalledExtensions());
ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
.AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa")
@@ -648,18 +653,21 @@
EXPECT_EQ(1u, service->extensions()->size());
EXPECT_EQ(0u, service->disabled_extensions()->size());
EXPECT_TRUE(FindHostWithPath(manager, "/toolstrip.html", 1));
+ ASSERT_TRUE(service->HasInstalledExtensions());
// After disabling, the toolstrip should go away.
service->DisableExtension("bjafgdebaacbbbecmhlhpofkepfkgcpa");
EXPECT_EQ(0u, service->extensions()->size());
EXPECT_EQ(1u, service->disabled_extensions()->size());
EXPECT_FALSE(FindHostWithPath(manager, "/toolstrip.html", 0));
+ ASSERT_TRUE(service->HasInstalledExtensions());
// And bring it back.
service->EnableExtension("bjafgdebaacbbbecmhlhpofkepfkgcpa");
EXPECT_EQ(1u, service->extensions()->size());
EXPECT_EQ(0u, service->disabled_extensions()->size());
EXPECT_TRUE(FindHostWithPath(manager, "/toolstrip.html", 1));
+ ASSERT_TRUE(service->HasInstalledExtensions());
}
// Helper function for common code shared by the 3 WindowOpen tests below.
@@ -803,9 +811,11 @@
basedir.AppendASCII("v2.crx"));
// Install version 1 of the extension.
+ ExtensionsService* service = browser()->profile()->GetExtensionsService();
+ ASSERT_FALSE(service->HasInstalledExtensions());
ASSERT_TRUE(InstallExtension(basedir.AppendASCII("v1.crx"), 1));
- ExtensionsService* service = browser()->profile()->GetExtensionsService();
const ExtensionList* extensions = service->extensions();
+ ASSERT_TRUE(service->HasInstalledExtensions());
ASSERT_EQ(1u, extensions->size());
ASSERT_EQ("ogjcoiohnmldgjemafoockdghcjciccf", extensions->at(0)->id());
ASSERT_EQ("1.0", extensions->at(0)->VersionString());
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698