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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <set> 5 #include <set>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "chrome/browser/download/download_history.h" 10 #include "chrome/browser/download/download_history.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 std::vector<content::DownloadItem*> items; 404 std::vector<content::DownloadItem*> items;
405 for (size_t i = 0; i < items_.size(); ++i) { 405 for (size_t i = 0; i < items_.size(); ++i) {
406 items.push_back(&item(i)); 406 items.push_back(&item(i));
407 } 407 }
408 EXPECT_CALL(*manager_.get(), GetAllDownloads(_)) 408 EXPECT_CALL(*manager_.get(), GetAllDownloads(_))
409 .WillRepeatedly(SetArgPointee<0>(items)); 409 .WillRepeatedly(SetArgPointee<0>(items));
410 } 410 }
411 411
412 private: 412 private:
413 MessageLoopForUI loop_; 413 base::MessageLoopForUI loop_;
414 content::TestBrowserThread ui_thread_; 414 content::TestBrowserThread ui_thread_;
415 std::vector<NiceMockDownloadItem*> items_; 415 std::vector<NiceMockDownloadItem*> items_;
416 scoped_refptr<content::MockDownloadManager> manager_; 416 scoped_refptr<content::MockDownloadManager> manager_;
417 FakeHistoryAdapter* history_; 417 FakeHistoryAdapter* history_;
418 scoped_ptr<DownloadHistory> download_history_; 418 scoped_ptr<DownloadHistory> download_history_;
419 content::DownloadManager::Observer* manager_observer_; 419 content::DownloadManager::Observer* manager_observer_;
420 content::DownloadItem::Observer* item_observer_; 420 content::DownloadItem::Observer* item_observer_;
421 size_t download_created_index_; 421 size_t download_created_index_;
422 422
423 DISALLOW_COPY_AND_ASSIGN(DownloadHistoryTest); 423 DISALLOW_COPY_AND_ASSIGN(DownloadHistoryTest);
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 item_observer()->OnDownloadUpdated(&item(0)); 803 item_observer()->OnDownloadUpdated(&item(0));
804 804
805 FinishCreateDownload(); 805 FinishCreateDownload();
806 EXPECT_TRUE(DownloadHistory::IsPersisted(&item(0))); 806 EXPECT_TRUE(DownloadHistory::IsPersisted(&item(0)));
807 807
808 // ItemAdded should call OnDownloadUpdated, which should detect that the item 808 // ItemAdded should call OnDownloadUpdated, which should detect that the item
809 // changed while it was being added and call UpdateDownload immediately. 809 // changed while it was being added and call UpdateDownload immediately.
810 info.opened = true; 810 info.opened = true;
811 ExpectDownloadUpdated(info); 811 ExpectDownloadUpdated(info);
812 } 812 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_path_reservation_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698