Chromium Code Reviews| Index: ui/display/mojo/display_struct_traits_unittest.cc |
| diff --git a/ui/display/mojo/display_struct_traits_unittest.cc b/ui/display/mojo/display_struct_traits_unittest.cc |
| index e087e68d63e240e979ba24140c472ba8a62b6b45..4b623168f480df53d761ed44a560a7723559b26e 100644 |
| --- a/ui/display/mojo/display_struct_traits_unittest.cc |
| +++ b/ui/display/mojo/display_struct_traits_unittest.cc |
| @@ -9,6 +9,7 @@ |
| #include "ui/display/display_layout.h" |
| #include "ui/display/mojo/display_struct_traits_test.mojom.h" |
| #include "ui/display/types/display_mode.h" |
| +#include "ui/display/types/gamma_ramp_rgb_entry.h" |
| #include "ui/gfx/geometry/rect.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -52,6 +53,12 @@ class DisplayStructTraitsTest : public testing::Test, |
| callback.Run(std::move(in)); |
| } |
| + void EchoGammaRampRGBEntry( |
| + const GammaRampRGBEntry& in, |
| + const EchoGammaRampRGBEntryCallback& callback) override { |
| + callback.Run(in); |
| + } |
| + |
| base::MessageLoop loop_; // A MessageLoop is needed for Mojo IPC to work. |
| mojo::BindingSet<mojom::DisplayStructTraitsTest> traits_test_bindings_; |
| @@ -219,4 +226,17 @@ TEST_F(DisplayStructTraitsTest, DisplayLayoutTwoMirrored) { |
| CheckDisplayLayoutsEqual(*input, *output); |
| } |
| +TEST_F(DisplayStructTraitsTest, BasicGammaRampRGBEntry) { |
| + GammaRampRGBEntry input, output; |
|
kylechar
2017/02/27 22:33:37
Can you make this const? It's a struct so you shou
thanhph1
2017/02/28 13:12:00
Done, cool!
|
| + input.r = 259; |
| + input.g = 81; |
| + input.b = 16; |
| + |
| + GetTraitsTestProxy()->EchoGammaRampRGBEntry(input, &output); |
|
kylechar
2017/02/27 22:33:37
Declare output down here right before you use it.
thanhph1
2017/02/28 13:12:01
Done.
|
| + |
| + EXPECT_EQ(input.r, output.r); |
| + EXPECT_EQ(input.g, output.g); |
| + EXPECT_EQ(input.b, output.b); |
| +} |
| + |
| } // namespace display |