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

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

Issue 2880933002: Download driver for components/download. (Closed)
Patch Set: Polish comment. Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/download/download_history.cc ('k') | components/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/download/download_ui_controller.h" 5 #include "chrome/browser/download/download_ui_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 history_downloads.reset(new std::vector<history::DownloadRow>()); 322 history_downloads.reset(new std::vector<history::DownloadRow>());
323 history_downloads->push_back(history::DownloadRow()); 323 history_downloads->push_back(history::DownloadRow());
324 history_downloads->front().id = 1; 324 history_downloads->front().id = 1;
325 325
326 std::vector<GURL> url_chain; 326 std::vector<GURL> url_chain;
327 GURL url; 327 GURL url;
328 std::unique_ptr<MockDownloadItem> item = CreateMockInProgressDownload(); 328 std::unique_ptr<MockDownloadItem> item = CreateMockInProgressDownload();
329 329
330 EXPECT_CALL(*item, GetOriginalMimeType()); 330 EXPECT_CALL(*item, GetOriginalMimeType());
331 EXPECT_CALL(*manager(), CheckForHistoryFilesRemoval()); 331 EXPECT_CALL(*manager(), CheckForHistoryFilesRemoval());
332 EXPECT_CALL(*manager(), PostInitialization());
332 333
333 { 334 {
334 testing::InSequence s; 335 testing::InSequence s;
335 testing::MockFunction<void()> mock_function; 336 testing::MockFunction<void()> mock_function;
336 // DownloadHistory will immediately try to create a download using the info 337 // DownloadHistory will immediately try to create a download using the info
337 // we push through the query callback. When DownloadManager::CreateDownload 338 // we push through the query callback. When DownloadManager::CreateDownload
338 // is called, we need to first invoke the OnDownloadCreated callback for 339 // is called, we need to first invoke the OnDownloadCreated callback for
339 // DownloadHistory before returning the DownloadItem since that's the 340 // DownloadHistory before returning the DownloadItem since that's the
340 // sequence of events expected by DownloadHistory. 341 // sequence of events expected by DownloadHistory.
341 base::Closure history_on_created_callback = 342 base::Closure history_on_created_callback =
(...skipping 15 matching lines...) Expand all
357 // DownloadUIController. It should ignore the download since it's marked as 358 // DownloadUIController. It should ignore the download since it's marked as
358 // being restored from history. 359 // being restored from history.
359 ASSERT_TRUE(manager_observer()); 360 ASSERT_TRUE(manager_observer());
360 manager_observer()->OnDownloadCreated(manager(), item.get()); 361 manager_observer()->OnDownloadCreated(manager(), item.get());
361 362
362 // Finally, the expectation we've been waiting for: 363 // Finally, the expectation we've been waiting for:
363 EXPECT_FALSE(notified_item()); 364 EXPECT_FALSE(notified_item());
364 } 365 }
365 366
366 } // namespace 367 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/download/download_history.cc ('k') | components/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698