Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc

Issue 2830703003: [views-mus] Support custom cursors. (Closed)
Patch Set: fix cast_shell_linux Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
+
+ ASSERT_EQ(1u, output.cursor_frames().size());
+ EXPECT_TRUE(output.cursor_frames().front().empty());
+}
+
} // namespace ui
« no previous file with comments | « services/ui/public/interfaces/cursor/cursor.mojom ('k') | services/ui/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698