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

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

Issue 14593012: BrowserContext should simply own DownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
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/all_download_item_notifier.h" 5 #include "chrome/browser/download/all_download_item_notifier.h"
6 6
7 #include "content/public/test/mock_download_item.h" 7 #include "content/public/test/mock_download_item.h"
8 #include "content/public/test/mock_download_manager.h" 8 #include "content/public/test/mock_download_manager.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 notifier_.reset(new AllDownloadItemNotifier( 63 notifier_.reset(new AllDownloadItemNotifier(
64 download_manager_.get(), &observer_)); 64 download_manager_.get(), &observer_));
65 } 65 }
66 66
67 void ClearNotifier() { 67 void ClearNotifier() {
68 notifier_.reset(); 68 notifier_.reset();
69 } 69 }
70 70
71 private: 71 private:
72 NiceMock<content::MockDownloadItem> item_; 72 NiceMock<content::MockDownloadItem> item_;
73 scoped_refptr<content::MockDownloadManager> download_manager_; 73 scoped_ptr<content::MockDownloadManager> download_manager_;
74 scoped_ptr<AllDownloadItemNotifier> notifier_; 74 scoped_ptr<AllDownloadItemNotifier> notifier_;
75 NiceMock<MockNotifierObserver> observer_; 75 NiceMock<MockNotifierObserver> observer_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifierTest); 77 DISALLOW_COPY_AND_ASSIGN(AllDownloadItemNotifierTest);
78 }; 78 };
79 79
80 } // namespace 80 } // namespace
81 81
82 TEST_F(AllDownloadItemNotifierTest, 82 TEST_F(AllDownloadItemNotifierTest,
83 AllDownloadItemNotifierTest_0) { 83 AllDownloadItemNotifierTest_0) {
(...skipping 29 matching lines...) Expand all
113 &manager(), &item()); 113 &manager(), &item());
114 114
115 EXPECT_CALL(manager(), RemoveObserver(NotifierAsManagerObserver())); 115 EXPECT_CALL(manager(), RemoveObserver(NotifierAsManagerObserver()));
116 NotifierAsManagerObserver()->ManagerGoingDown(&manager()); 116 NotifierAsManagerObserver()->ManagerGoingDown(&manager());
117 117
118 EXPECT_CALL(item(), RemoveObserver(NotifierAsItemObserver())); 118 EXPECT_CALL(item(), RemoveObserver(NotifierAsItemObserver()));
119 NotifierAsItemObserver()->OnDownloadDestroyed(&item()); 119 NotifierAsItemObserver()->OnDownloadDestroyed(&item());
120 120
121 ClearNotifier(); 121 ClearNotifier();
122 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698