Chromium Code Reviews| Index: services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc |
| diff --git a/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc b/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc |
| index db2c6c4754af3d0c50399d3739ec4787635bf8f4..011b4122f4495bbc7acb6f8a95d6a923a7a40e08 100644 |
| --- a/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc |
| +++ b/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc |
| @@ -99,4 +99,21 @@ TEST_F(CursorStructTraitsTest, TestBitmapCursor) { |
| } |
| } |
| +// Test that we deal with empty bitmaps. (When a cursor resource isn't loaded |
| +// in the renderer, the renderer will send a kCurstomCursor with an empty |
| +// bitmap.) |
| +TEST_F(CursorStructTraitsTest, TestEmptyCursor) { |
| + const base::TimeDelta kFrameDelay = base::TimeDelta::FromMilliseconds(15); |
| + const gfx::Point kHotspot = gfx::Point(5, 2); |
| + const float kScale = 2.0f; |
| + |
| + ui::CursorData input(kHotspot, {SkBitmap()}, kScale, kFrameDelay); |
| + |
| + ui::CursorData output; |
| + ASSERT_TRUE(EchoCursorData(input, &output)); |
|
sky
2017/04/26 22:16:15
optional: you don't need to route through mojom to
Elliot Glaysher
2017/04/26 23:09:04
I'm confused. Isn't that what I'm doing here? This
sky
2017/04/26 23:35:01
Indeed you are. I was confused by the name. Sorry.
|
| + |
| + ASSERT_EQ(1u, output.cursor_frames().size()); |
| + EXPECT_TRUE(output.cursor_frames().front().empty()); |
| +} |
| + |
| } // namespace ui |