chromium/chrome/browser/ui/profiles/profile_colors_util_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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 that all colors matching the native light-or-dark color scheme are
// available with no other profiles.
TEST_P(ProfileColorsUtilTestDarkModeParam,
       GenerateNewProfileColorWithNoColoredProfile) {}

INSTANTIATE_TEST_SUITE_P();

// Test that the taken colors are not available.
TEST_F(ProfileColorsUtilTest,
       GenerateNewProfileColorWithMultipleColoredProfiles) {}

// Test that specifying a profile restricts the choice to colors of similar
// lightness.
TEST_F(ProfileColorsUtilTest, GenerateNewProfileColorForCurrentProfile) {}

// Test that if all colors are taken, then again all are available.
TEST_F(ProfileColorsUtilTest, GenerateNewProfileColorWithAllColorsTaken) {}

// Test that when all colors with similar lightness are taken, all saturated
// colors are available.
TEST_F(ProfileColorsUtilTest,
       GenerateNewProfileColorForCurrentProfileWithAllSimilarColorsTaken) {}

}  // namespace