#include "chrome/browser/ui/webui/cr_components/theme_color_picker/theme_color_picker_handler.h"
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "base/containers/fixed_flat_map.h"
#include "base/memory/raw_ptr.h"
#include "base/test/mock_callback.h"
#include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h"
#include "chrome/browser/search/background/ntp_custom_background_service.h"
#include "chrome/browser/search/background/ntp_custom_background_service_observer.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/webui/cr_components/theme_color_picker/customize_chrome_colors.h"
#include "chrome/common/themes/autogenerated_theme_util.h"
#include "chrome/test/base/testing_profile.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_web_contents_factory.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_builder.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/mojom/themes.mojom.h"
#include "ui/color/color_provider.h"
#include "ui/color/color_provider_key.h"
#include "ui/color/dynamic_color/palette_factory.h"
#include "ui/native_theme/native_theme.h"
namespace content {
class BrowserContext;
}
namespace {
_;
ui::ColorProviderKey::SchemeVariant GetSchemeVariant(
ui::mojom::BrowserColorVariant color_variant) { … }
class MockClient : public theme_color_picker::mojom::ThemeColorPickerClient { … };
class MockNtpCustomBackgroundService : public NtpCustomBackgroundService { … };
class MockThemeService : public ThemeService { … };
std::unique_ptr<TestingProfile> MakeTestingProfile() { … }
}
class ThemeColorPickerHandlerTest : public testing::Test { … };
TEST_F(ThemeColorPickerHandlerTest, GetChromeColors) { … }
enum class ThemeUpdateSource { … };
class ThemeColorPickerHandlerSetThemeTest
: public ThemeColorPickerHandlerTest,
public ::testing::WithParamInterface<ThemeUpdateSource> { … };
TEST_P(ThemeColorPickerHandlerSetThemeTest, SetTheme) { … }
TEST_P(ThemeColorPickerHandlerSetThemeTest, SetThemeColorSchemeGM3) { … }
TEST_P(ThemeColorPickerHandlerSetThemeTest, UsingDeviceThemeGM3) { … }
TEST_P(ThemeColorPickerHandlerSetThemeTest, SetThemeWithDailyRefresh) { … }
TEST_P(ThemeColorPickerHandlerSetThemeTest, SetUploadedImage) { … }
TEST_P(ThemeColorPickerHandlerSetThemeTest, SetThirdPartyTheme) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(ThemeColorPickerHandlerTest, SetDefaultColor) { … }
TEST_F(ThemeColorPickerHandlerTest, SetGreyDefaultColor) { … }
TEST_F(ThemeColorPickerHandlerTest, SetGreyDefaultColorGM3) { … }
TEST_F(ThemeColorPickerHandlerTest, SetSeedColor) { … }
TEST_F(ThemeColorPickerHandlerTest, RemoveBackgroundImage) { … }