// Copyright 2022 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_BROWSER_THEMES_THEME_SERVICE_TEST_UTILS_H_
#define CHROME_BROWSER_THEMES_THEME_SERVICE_TEST_UTILS_H_

#include <ostream>
#include <string>

#include "base/memory/scoped_refptr.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/protocol/theme_specifics.pb.h"
#include "extensions/common/extension.h"
#include "third_party/skia/include/core/SkColor.h"

namespace theme_service::test {

// Struct to distinguish SkColor (aliased to uint32_t) for printing.
struct PrintableSkColor {
  friend constexpr bool operator==(const PrintableSkColor&,
                                   const PrintableSkColor&) = default;

  const SkColor color;
};

std::ostream& operator<<(std::ostream& os, PrintableSkColor printable_color);

std::string ColorIdToString(ui::ColorId id);

scoped_refptr<extensions::Extension> MakeThemeExtension(
    const base::FilePath& extension_path,
    const std::string& id,
    const std::string& name,
    extensions::mojom::ManifestLocation location,
    const std::string& update_url);

syncer::SyncDataList MakeThemeDataList(
    const sync_pb::ThemeSpecifics& theme_specifics);

syncer::SyncChangeList MakeThemeChangeList(
    const sync_pb::ThemeSpecifics& theme_specifics);

sync_pb::ThemeSpecifics EmptySpecifics();

sync_pb::ThemeSpecifics CreateThemeSpecificsWithExtensionTheme(
    const std::string& id,
    const std::string& name,
    const std::string& url);

sync_pb::ThemeSpecifics CreateThemeSpecificsWithAutogeneratedColorTheme();

sync_pb::ThemeSpecifics CreateThemeSpecificsWithColorTheme();

sync_pb::ThemeSpecifics CreateThemeSpecificsWithGrayscaleTheme();

sync_pb::ThemeSpecifics CreateThemeSpecificsWithCustomNtpBackground(
    const std::string& background_url);

}  // namespace theme_service::test

#endif  // CHROME_BROWSER_THEMES_THEME_SERVICE_TEST_UTILS_H_
