// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_TEST_BASE_FAKE_PROFILE_MANAGER_H_ #define CHROME_TEST_BASE_FAKE_PROFILE_MANAGER_H_ #include <memory> #include "chrome/browser/profiles/profile_manager.h" class Profile; namespace base { class FilePath; } // Fake implementation of ProfileManager that creates a `TestingProfile` instead // of a regular `Profile`. // // This class is useful for testing code that creates new profiles, when // `TestingProfile` cannot be created directly in the test and injected into // ProfileManager via `ProfileManager::RegisterTestingProfile()`. // // To override the `ProfileManager` instance in tests, call // `TestingBrowserProcess::GetGlobal()->SetProfileManager( // std::make_unique<FakeProfileManager>(user_data_dir));` class FakeProfileManager : public ProfileManagerWithoutInit { … }; #endif // CHROME_TEST_BASE_FAKE_PROFILE_MANAGER_H_