| Index: chrome/browser/ui/browser_close_unittest.cc
|
| diff --git a/chrome/browser/ui/browser_close_unittest.cc b/chrome/browser/ui/browser_close_unittest.cc
|
| index 1cd55e202a2a12a23025404ef2fa1495833f3162..d6a123fe4349783fa58b233e002ffbcf90c45755 100644
|
| --- a/chrome/browser/ui/browser_close_unittest.cc
|
| +++ b/chrome/browser/ui/browser_close_unittest.cc
|
| @@ -8,8 +8,8 @@
|
| #include "base/macros.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "chrome/browser/download/chrome_download_manager_delegate.h"
|
| -#include "chrome/browser/download/download_service.h"
|
| -#include "chrome/browser/download/download_service_factory.h"
|
| +#include "chrome/browser/download/download_core_service.h"
|
| +#include "chrome/browser/download/download_core_service_factory.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/test/base/test_browser_window.h"
|
| #include "chrome/test/base/testing_browser_process.h"
|
| @@ -21,22 +21,22 @@
|
| #include "extensions/features/features.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| -class TestingDownloadService : public DownloadService {
|
| +class TestingDownloadCoreService : public DownloadCoreService {
|
| public:
|
| - TestingDownloadService() : download_count_(0) {}
|
| - ~TestingDownloadService() override {}
|
| + TestingDownloadCoreService() : download_count_(0) {}
|
| + ~TestingDownloadCoreService() override {}
|
|
|
| // All methods that aren't expected to be called in the execution of
|
| // this unit test are marked to result in test failure. Using a simple
|
| // mock for this class should be re-evaluated if any of these
|
| // methods are being called; it may mean that a more fully featured
|
| - // DownloadService implementation is needed.
|
| + // DownloadCoreService implementation is needed.
|
|
|
| void SetDownloadCount(int download_count) {
|
| download_count_ = download_count;
|
| }
|
|
|
| - // DownloadService
|
| + // DownloadCoreService
|
| ChromeDownloadManagerDelegate* GetDownloadManagerDelegate() override {
|
| ADD_FAILURE();
|
| return nullptr;
|
| @@ -75,12 +75,12 @@ class TestingDownloadService : public DownloadService {
|
| private:
|
| int download_count_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(TestingDownloadService);
|
| + DISALLOW_COPY_AND_ASSIGN(TestingDownloadCoreService);
|
| };
|
|
|
| -static std::unique_ptr<KeyedService> CreateTestingDownloadService(
|
| +static std::unique_ptr<KeyedService> CreateTestingDownloadCoreService(
|
| content::BrowserContext* browser_context) {
|
| - return std::unique_ptr<KeyedService>(new TestingDownloadService());
|
| + return std::unique_ptr<KeyedService>(new TestingDownloadCoreService());
|
| }
|
|
|
| class BrowserCloseTest : public testing::Test {
|
| @@ -141,12 +141,12 @@ class BrowserCloseTest : public testing::Test {
|
| void ConfigureCreatedProfile(Profile* profile,
|
| int num_windows,
|
| int num_downloads) {
|
| - DownloadServiceFactory::GetInstance()->SetTestingFactory(
|
| - profile, &CreateTestingDownloadService);
|
| - DownloadService* download_service(
|
| - DownloadServiceFactory::GetForBrowserContext(profile));
|
| - TestingDownloadService* mock_download_service(
|
| - static_cast<TestingDownloadService*>(download_service));
|
| + DownloadCoreServiceFactory::GetInstance()->SetTestingFactory(
|
| + profile, &CreateTestingDownloadCoreService);
|
| + DownloadCoreService* download_core_service(
|
| + DownloadCoreServiceFactory::GetForBrowserContext(profile));
|
| + TestingDownloadCoreService* mock_download_service(
|
| + static_cast<TestingDownloadCoreService*>(download_core_service));
|
| mock_download_service->SetDownloadCount(num_downloads);
|
|
|
| CHECK(browser_windows_.end() == browser_windows_.find(profile));
|
|
|