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

Unified Diff: chrome/browser/component_updater/test/crx_downloader_unittest.cc

Issue 101043010: Added support for multiple urls in the component updater. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
Index: chrome/browser/component_updater/test/crx_downloader_unittest.cc
diff --git a/chrome/browser/component_updater/test/crx_downloader_unittest.cc b/chrome/browser/component_updater/test/crx_downloader_unittest.cc
index ba4415cea840a0e60c4a038b4da1cbbe8204695d..42a5d2e441445551e3ff4a0a81d4ddf99345a368 100644
--- a/chrome/browser/component_updater/test/crx_downloader_unittest.cc
+++ b/chrome/browser/component_updater/test/crx_downloader_unittest.cc
@@ -104,7 +104,8 @@ void CrxDownloaderTest::TearDown() {
}
void CrxDownloaderTest::Quit() {
- quit_closure_.Run();
+ if (!quit_closure_.is_null())
+ quit_closure_.Run();
}
void CrxDownloaderTest::DownloadComplete(
@@ -133,6 +134,18 @@ void CrxDownloaderTest::RunThreadsUntilIdle() {
base::RunLoop().RunUntilIdle();
}
+// Tests that starting a download without a url results in an error.
+TEST_F(CrxDownloaderTest, NoUrl) {
+ std::vector<GURL> urls;
+ crx_downloader_->StartDownload(urls);
+
+ RunThreadsUntilIdle();
+ EXPECT_EQ(-1, error_);
+ EXPECT_EQ(kExpectedContext, crx_context_);
+
+ EXPECT_EQ(1, num_calls_);
+}
+
// Tests that downloading from one url is successful.
TEST_F(CrxDownloaderTest, OneUrl) {
const GURL expected_crx_url =

Powered by Google App Engine
This is Rietveld 408576698