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

Unified Diff: chrome/browser/extensions/extension_updater_unittest.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 | « chrome/browser/extensions/extension_updater.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_updater_unittest.cc
===================================================================
--- chrome/browser/extensions/extension_updater_unittest.cc (revision 33298)
+++ chrome/browser/extensions/extension_updater_unittest.cc (working copy)
@@ -61,6 +61,11 @@
const std::vector<std::string>& blacklist) {
EXPECT_TRUE(false);
}
+
+ virtual bool HasInstalledExtensions() {
+ EXPECT_TRUE(false);
+ return false;
+ }
private:
DISALLOW_COPY_AND_ASSIGN(MockService);
};
@@ -116,7 +121,7 @@
class ServiceForManifestTests : public MockService {
public:
- ServiceForManifestTests() {}
+ ServiceForManifestTests() : has_installed_extensions_(false) {}
virtual ~ServiceForManifestTests() {}
@@ -136,8 +141,17 @@
extensions_ = extensions;
}
+ virtual bool HasInstalledExtensions() {
+ return has_installed_extensions_;
+ }
+
+ void set_has_installed_extensions(bool value) {
+ has_installed_extensions_ = value;
+ }
+
private:
ExtensionList extensions_;
+ bool has_installed_extensions_;
};
class ServiceForDownloadTests : public MockService {
@@ -316,9 +330,18 @@
// Tell the updater that it's time to do update checks.
SimulateTimerFired(updater.get());
- // Get the url our mock fetcher was asked to fetch.
+ // No extensions installed, so nothing should have been fetched.
TestURLFetcher* fetcher =
factory.GetFetcherByID(ExtensionUpdater::kManifestFetcherId);
+ EXPECT_TRUE(fetcher == NULL);
+
+ // Try again with an extension installed.
+ service.set_has_installed_extensions(true);
+ SimulateTimerFired(updater.get());
+
+ // Get the url our mock fetcher was asked to fetch.
+ fetcher = factory.GetFetcherByID(ExtensionUpdater::kManifestFetcherId);
+ ASSERT_FALSE(fetcher == NULL);
const GURL& url = fetcher->original_url();
EXPECT_FALSE(url.is_empty());
« no previous file with comments | « chrome/browser/extensions/extension_updater.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698