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

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

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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
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 "chrome/browser/download/download_history.h" 5 #include "chrome/browser/download/download_history.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 public: 184 public:
185 // Generic callback that receives a pointer to a StrictMockDownloadItem. 185 // Generic callback that receives a pointer to a StrictMockDownloadItem.
186 typedef base::Callback<void(content::MockDownloadItem*)> DownloadItemCallback; 186 typedef base::Callback<void(content::MockDownloadItem*)> DownloadItemCallback;
187 187
188 DownloadHistoryTest() 188 DownloadHistoryTest()
189 : ui_thread_(content::BrowserThread::UI, &loop_), 189 : ui_thread_(content::BrowserThread::UI, &loop_),
190 manager_(new content::MockDownloadManager()), 190 manager_(new content::MockDownloadManager()),
191 history_(NULL), 191 history_(NULL),
192 manager_observer_(NULL), 192 manager_observer_(NULL),
193 download_created_index_(0) {} 193 download_created_index_(0) {}
194 ~DownloadHistoryTest() override { STLDeleteElements(&items_); } 194 ~DownloadHistoryTest() override { base::STLDeleteElements(&items_); }
195 195
196 protected: 196 protected:
197 void TearDown() override { download_history_.reset(); } 197 void TearDown() override { download_history_.reset(); }
198 198
199 content::MockDownloadManager& manager() { return *manager_.get(); } 199 content::MockDownloadManager& manager() { return *manager_.get(); }
200 content::MockDownloadItem& item(size_t index) { return *items_[index]; } 200 content::MockDownloadItem& item(size_t index) { return *items_[index]; }
201 DownloadHistory* download_history() { return download_history_.get(); } 201 DownloadHistory* download_history() { return download_history_.get(); }
202 202
203 void SetManagerObserver( 203 void SetManagerObserver(
204 content::DownloadManager::Observer* manager_observer) { 204 content::DownloadManager::Observer* manager_observer) {
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 FinishCreateDownload(); 895 FinishCreateDownload();
896 EXPECT_TRUE(DownloadHistory::IsPersisted(&item(0))); 896 EXPECT_TRUE(DownloadHistory::IsPersisted(&item(0)));
897 897
898 // ItemAdded should call OnDownloadUpdated, which should detect that the item 898 // ItemAdded should call OnDownloadUpdated, which should detect that the item
899 // changed while it was being added and call UpdateDownload immediately. 899 // changed while it was being added and call UpdateDownload immediately.
900 info.opened = true; 900 info.opened = true;
901 ExpectDownloadUpdated(info); 901 ExpectDownloadUpdated(info);
902 } 902 }
903 903
904 } // anonymous namespace 904 } // anonymous namespace
OLDNEW
« no previous file with comments | « chrome/browser/diagnostics/diagnostics_model.cc ('k') | chrome/browser/download/download_path_reservation_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698