// 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. // // Very quick HSV primer for those unfamiliar with it: // It helps to think of HSV like this: // h is in (0,360) and draws a circle of colors, with r = 0, b = 120, g = 240 // s is in (0,1) and is the distance from the center of that circle - higher // values are more intense, with s = 0 being white, s = 1 being full color // and then HSV is the 3d space caused by projecting that circle into a // cylinder, with v in (0,1) being how far along the cylinder you are; v = 0 is // black, v = 1 is full color intensity #include <tuple> #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/events/test/event_generator.h" #include "ui/views/background.h" #include "ui/views/color_chooser/color_chooser_listener.h" #include "ui/views/color_chooser/color_chooser_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_utils.h" namespace { class TestChooserListener : public views::ColorChooserListener { … }; class ColorChooserTest : public views::ViewsTestBase { … }; TEST_F(ColorChooserTest, ShowsInitialColor) { … } TEST_F(ColorChooserTest, AdjustingTextAdjustsShown) { … } TEST_F(ColorChooserTest, HueSliderChangesHue) { … } // Missing tests, TODO: // TEST_F(ColorChooserTest, SatValueChooserChangesSatValue) // TEST_F(ColorChooserTest, UpdateFromWebUpdatesShownValues) // TEST_F(ColorChooserTest, AdjustingTextAffectsHue) // TEST_F(ColorChooserTest, AdjustingTextAffectsSatValue) } // namespace