chromium/ui/gfx/color_analysis_unittest.cc

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

#include "ui/gfx/color_analysis.h"

#include <stddef.h>
#include <stdint.h>

#include <exception>
#include <vector>

#include "base/functional/bind.h"
#include "skia/ext/platform_canvas.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image.h"

namespace color_utils {

const unsigned char k1x1White[] =;

const unsigned char k1x3BlueWhite[] =;

const unsigned char k1x3BlueRed[] =;

const HSL kDefaultLowerBound =;
const HSL kDefaultUpperBound =;

// Creates a 1-dimensional png of the pixel colors found in |colors|.
scoped_refptr<base::RefCountedMemory> CreateTestPNG(
    const std::vector<SkColor>& colors) {}

class MockKMeanImageSampler : public KMeanImageSampler {};

// Return true if a color channel is approximately equal to an expected value.
bool ChannelApproximatelyEqual(int expected, uint8_t channel) {}

class ColorAnalysisTest : public testing::Test {};

TEST_F(ColorAnalysisTest, CalculatePNGKMeanAllWhite) {}

TEST_F(ColorAnalysisTest, CalculatePNGKMeanIgnoreWhiteLightness) {}

TEST_F(ColorAnalysisTest, CalculatePNGKMeanPickMostCommon) {}

TEST_F(ColorAnalysisTest, CalculatePNGKMeanIgnoreRedHue) {}

TEST_F(ColorAnalysisTest, CalculatePNGKMeanIgnoreGreySaturation) {}

TEST_F(ColorAnalysisTest, GridSampler) {}

TEST_F(ColorAnalysisTest, FindClosestColor) {}

TEST_F(ColorAnalysisTest, CalculateKMeanColorOfBitmap) {}

// Regression test for heap-buffer-underflow. https://crbug.com/970343
TEST_F(ColorAnalysisTest, CalculateKMeanColorOfSmallImage) {}

TEST_F(ColorAnalysisTest, ComputeProminentColors) {}

TEST_F(ColorAnalysisTest, ComputeColorSwatches) {}

TEST_F(ColorAnalysisTest, ComputeColorSwatches_MaxConsideredPixels) {}

TEST_F(ColorAnalysisTest, ComputeColorSwatches_Filter) {}

}  // namespace color_utils