| OLD | NEW |
| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 content::DownloadItem* notified_item_; | 148 content::DownloadItem* notified_item_; |
| 149 base::WeakPtrFactory<content::DownloadItem*> notified_item_receiver_factory_; | 149 base::WeakPtrFactory<content::DownloadItem*> notified_item_receiver_factory_; |
| 150 | 150 |
| 151 HistoryAdapter* history_adapter_; | 151 HistoryAdapter* history_adapter_; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 // static | 154 // static |
| 155 std::unique_ptr<KeyedService> | 155 std::unique_ptr<KeyedService> |
| 156 DownloadUIControllerTest::TestingDownloadServiceFactory( | 156 DownloadUIControllerTest::TestingDownloadServiceFactory( |
| 157 content::BrowserContext* browser_context) { | 157 content::BrowserContext* browser_context) { |
| 158 return base::WrapUnique( | 158 return base::MakeUnique<TestDownloadService>( |
| 159 new TestDownloadService(Profile::FromBrowserContext(browser_context))); | 159 Profile::FromBrowserContext(browser_context)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 DownloadUIControllerTest::DownloadUIControllerTest() | 162 DownloadUIControllerTest::DownloadUIControllerTest() |
| 163 : download_history_manager_observer_(NULL), | 163 : download_history_manager_observer_(NULL), |
| 164 manager_observer_(NULL), | 164 manager_observer_(NULL), |
| 165 notified_item_(NULL), | 165 notified_item_(NULL), |
| 166 notified_item_receiver_factory_(¬ified_item_) { | 166 notified_item_receiver_factory_(¬ified_item_) { |
| 167 } | 167 } |
| 168 | 168 |
| 169 void DownloadUIControllerTest::SetUp() { | 169 void DownloadUIControllerTest::SetUp() { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // DownloadUIController. It should ignore the download since it's marked as | 352 // DownloadUIController. It should ignore the download since it's marked as |
| 353 // being restored from history. | 353 // being restored from history. |
| 354 ASSERT_TRUE(manager_observer()); | 354 ASSERT_TRUE(manager_observer()); |
| 355 manager_observer()->OnDownloadCreated(manager(), item.get()); | 355 manager_observer()->OnDownloadCreated(manager(), item.get()); |
| 356 | 356 |
| 357 // Finally, the expectation we've been waiting for: | 357 // Finally, the expectation we've been waiting for: |
| 358 EXPECT_FALSE(notified_item()); | 358 EXPECT_FALSE(notified_item()); |
| 359 } | 359 } |
| 360 | 360 |
| 361 } // namespace | 361 } // namespace |
| OLD | NEW |