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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api_unittest.cc

Issue 10912183: Remove DownloadManager::GetDownloadItem in favor of GetDownload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/api/downloads/downloads_api_unittest.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
index aee109d01d66141190dda8bca307f956f1e6c4c0..4c3d208e1a6d00b281276a3d085ed81fa3212123 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc
@@ -1411,8 +1411,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1452,8 +1451,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1606,8 +1604,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1647,8 +1644,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1691,8 +1687,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1736,8 +1731,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1771,8 +1765,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1819,8 +1812,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1857,8 +1849,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1896,8 +1887,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1943,8 +1933,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -1982,8 +1971,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -2017,8 +2005,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_TRUE(result.get());
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
@@ -2066,8 +2053,7 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
int result_id = -1;
ASSERT_TRUE(result->GetAsInteger(&result_id));
- DownloadItem* item = GetCurrentManager()->GetActiveDownloadItem(result_id);
- if (!item) item = GetCurrentManager()->GetDownloadItem(result_id);
+ DownloadItem* item = GetCurrentManager()->GetDownload(result_id);
ASSERT_TRUE(item);
ScopedCancellingItem canceller(item);
ASSERT_EQ(download_url, item->GetOriginalUrl().spec());
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698