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

Side by Side Diff: content/browser/download/download_id_unittest.cc

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Mac & Clang issues. 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 "content/browser/download/download_id.h" 5 #include "content/browser/download/download_id.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 } 38 }
39 39
40 ~DownloadIdTest() { 40 ~DownloadIdTest() {
41 for (size_t i = 0; i < num_managers_; ++i) 41 for (size_t i = 0; i < num_managers_; ++i)
42 download_managers_[i] = NULL; // Releases & deletes. 42 download_managers_[i] = NULL; // Releases & deletes.
43 } 43 }
44 44
45 protected: 45 protected:
46 scoped_ptr<MockDownloadManagerDelegate> download_manager_delegate_; 46 scoped_ptr<MockDownloadManagerDelegate> download_manager_delegate_;
47 scoped_refptr<DownloadManager> download_managers_[2]; 47 scoped_refptr<DownloadManagerInterface> download_managers_[2];
48 MessageLoopForUI message_loop_; 48 MessageLoopForUI message_loop_;
49 // Necessary to delete |DownloadManager|s. 49 // Necessary to delete |DownloadManager|s.
50 content::TestBrowserThread ui_thread_; 50 content::TestBrowserThread ui_thread_;
51 size_t num_managers_; 51 size_t num_managers_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(DownloadIdTest); 53 DISALLOW_COPY_AND_ASSIGN(DownloadIdTest);
54 }; 54 };
55 55
56 TEST_F(DownloadIdTest, Local) { 56 TEST_F(DownloadIdTest, Local) {
57 DownloadId id1(download_managers_[0], 23); 57 DownloadId id1(download_managers_[0], 23);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_EQ(kLocalId[2], map[id3]); 142 EXPECT_EQ(kLocalId[2], map[id3]);
143 last = map.end(); 143 last = map.end();
144 EXPECT_FALSE(last == map.find(id1)); 144 EXPECT_FALSE(last == map.find(id1));
145 EXPECT_FALSE(last == map.find(id2)); 145 EXPECT_FALSE(last == map.find(id2));
146 EXPECT_FALSE(last == map.find(id3)); 146 EXPECT_FALSE(last == map.find(id3));
147 147
148 EXPECT_FALSE(id1 == id2); 148 EXPECT_FALSE(id1 == id2);
149 EXPECT_LT(id1, id2); 149 EXPECT_LT(id1, id2);
150 } 150 }
151 151
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698