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

Unified Diff: chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc

Issue 10915180: Make DownloadHistory observe manager, items (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/ui/webui/downloads_dom_handler_browsertest.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
index 0c90358815c5e8d0dcab635b4b701170eb07a0d4..2d2d4c1368b9f0f256094b9af97360d3d08a947f 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
@@ -5,6 +5,7 @@
#include "base/json/json_reader.h"
#include "base/scoped_temp_dir.h"
#include "base/values.h"
+#include "chrome/browser/history/download_persistent_store_info.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -12,7 +13,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/download_persistent_store_info.h"
#include "content/public/browser/web_contents.h"
namespace {
@@ -111,22 +111,16 @@ IN_PROC_BROWSER_TEST_F(DownloadsDOMHandlerTest,
GURL url = test_server()->GetURL("files/downloads/image.jpg");
base::Time current(base::Time::Now());
- content::DownloadPersistentStoreInfo population_entries[] = {
- content::DownloadPersistentStoreInfo(
- FilePath(FILE_PATH_LITERAL("/path/to/file")),
- url,
- GURL(""),
- current - base::TimeDelta::FromMinutes(5),
- current,
- 128,
- 128,
- content::DownloadItem::COMPLETE,
- 1,
- false),
- };
- std::vector<content::DownloadPersistentStoreInfo> entries(
- population_entries, population_entries + arraysize(population_entries));
- download_manager()->OnPersistentStoreQueryComplete(&entries);
+ download_manager()->CreateDownloadItem(
+ FilePath(FILE_PATH_LITERAL("/path/to/file")),
+ url,
+ GURL(""),
+ current - base::TimeDelta::FromMinutes(5),
+ current,
+ 128,
+ 128,
+ content::DownloadItem::COMPLETE,
+ false);
content::RunMessageLoop();
ASSERT_EQ(1, static_cast<int>(mddh.downloads_list()->GetSize()));

Powered by Google App Engine
This is Rietveld 408576698