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

Side by Side Diff: chrome/browser/download/download_browsertest.cc

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created a non-inlined destructor for MockDownloadManager. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 }; 160 };
161 161
162 // Get History Information. 162 // Get History Information.
163 class DownloadsHistoryDataCollector { 163 class DownloadsHistoryDataCollector {
164 public: 164 public:
165 DownloadsHistoryDataCollector(int64 download_db_handle, 165 DownloadsHistoryDataCollector(int64 download_db_handle,
166 DownloadManager* manager) 166 DownloadManager* manager)
167 : result_valid_(false), 167 : result_valid_(false),
168 download_db_handle_(download_db_handle) { 168 download_db_handle_(download_db_handle) {
169 HistoryService* hs = 169 HistoryService* hs =
170 Profile::FromBrowserContext(manager->browser_context())-> 170 Profile::FromBrowserContext(manager->BrowserContext())->
171 GetHistoryService(Profile::EXPLICIT_ACCESS); 171 GetHistoryService(Profile::EXPLICIT_ACCESS);
172 DCHECK(hs); 172 DCHECK(hs);
173 hs->QueryDownloads( 173 hs->QueryDownloads(
174 &callback_consumer_, 174 &callback_consumer_,
175 base::Bind(&DownloadsHistoryDataCollector::OnQueryDownloadsComplete, 175 base::Bind(&DownloadsHistoryDataCollector::OnQueryDownloadsComplete,
176 base::Unretained(this))); 176 base::Unretained(this)));
177 177
178 // TODO(rdsmith): Move message loop out of constructor. 178 // TODO(rdsmith): Move message loop out of constructor.
179 // Cannot complete immediately because the history backend runs on a 179 // Cannot complete immediately because the history backend runs on a
180 // separate thread, so we can assume that the RunMessageLoop below will 180 // separate thread, so we can assume that the RunMessageLoop below will
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); 1539 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen());
1540 1540
1541 // Download shelf should close. Download panel stays open on ChromeOS. 1541 // Download shelf should close. Download panel stays open on ChromeOS.
1542 CheckDownloadUI(browser(), false, true, FilePath()); 1542 CheckDownloadUI(browser(), false, true, FilePath());
1543 1543
1544 // Check that the extension was installed. 1544 // Check that the extension was installed.
1545 ExtensionService* extension_service = 1545 ExtensionService* extension_service =
1546 browser()->profile()->GetExtensionService(); 1546 browser()->profile()->GetExtensionService();
1547 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); 1547 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false));
1548 } 1548 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698