#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/profiles/profile_colors_util.h"
#include "base/containers/contains.h"
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_init_params.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/themes/browser_theme_pack.h"
#include "chrome/browser/themes/custom_theme_supplier.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/account_id/account_id.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h"
namespace {
constexpr size_t kColorsCount = …;
size_t ReturnNth(size_t n, size_t size) { … }
size_t CaptureCountAndReturnZero(size_t* storage, size_t count) { … }
const chrome_colors::ColorInfo& GetColor(size_t index) { … }
SkColor GetHighlightColor(size_t index) { … }
bool IsColorMatchingColorScheme(SkColor color) { … }
class ProfileColorsUtilTest : public testing::Test { … };
TEST_F(ProfileColorsUtilTest, IsSaturatedForAutoselection) { … }
TEST_F(ProfileColorsUtilTest, IsLightForAutoselection) { … }
class ProfileColorsUtilTestDarkModeParam
: public ProfileColorsUtilTest,
public testing::WithParamInterface<bool> { … };
TEST_P(ProfileColorsUtilTestDarkModeParam,
GenerateNewProfileColorWithNoColoredProfile) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(ProfileColorsUtilTest,
GenerateNewProfileColorWithMultipleColoredProfiles) { … }
TEST_F(ProfileColorsUtilTest, GenerateNewProfileColorForCurrentProfile) { … }
TEST_F(ProfileColorsUtilTest, GenerateNewProfileColorWithAllColorsTaken) { … }
TEST_F(ProfileColorsUtilTest,
GenerateNewProfileColorForCurrentProfileWithAllSimilarColorsTaken) { … }
}