diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 19:44:27 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 19:44:27 +0000 |
commit | cdcc98e312f4cbad9c270a61097b861cfe6968b8 (patch) | |
tree | 2fedddd4a1c20c75783fde6e336a7baa5c394ec1 /webkit/glue/webcursor_unittest.cc | |
parent | 63f8aa498d2ea99c7e2580cc51df1c8072abdc29 (diff) | |
download | chromium_src-cdcc98e312f4cbad9c270a61097b861cfe6968b8.zip chromium_src-cdcc98e312f4cbad9c270a61097b861cfe6968b8.tar.gz chromium_src-cdcc98e312f4cbad9c270a61097b861cfe6968b8.tar.bz2 |
Ensure that custom cursors set by windowless flash plugins get marshaled correctly back
to the renderer and eventually to the browser. We rely on the HCURSOR getting marshaled
across on windows. However this regressed when code to validate the custom cursor info
was added in the WebCursor deserialization routines.
Fixes bug http://code.google.com/p/chromium/issues/list?cursor=39436
BUG=39436
TEST=Covered by new custom cursor deserialization unit test.
Review URL: http://codereview.chromium.org/5686001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webcursor_unittest.cc')
-rw-r--r-- | webkit/glue/webcursor_unittest.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/webkit/glue/webcursor_unittest.cc b/webkit/glue/webcursor_unittest.cc index 6e7701d..f449515 100644 --- a/webkit/glue/webcursor_unittest.cc +++ b/webkit/glue/webcursor_unittest.cc @@ -15,7 +15,7 @@ TEST(WebCursorTest, CursorSerialization) { // This is a valid custom cursor. Pickle ok_custom_pickle; // Type and hotspots. - ok_custom_pickle.WriteInt(0); + ok_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); ok_custom_pickle.WriteInt(0); ok_custom_pickle.WriteInt(0); // X & Y @@ -32,7 +32,7 @@ TEST(WebCursorTest, CursorSerialization) { // This custom cursor has not been send with enough data. Pickle short_custom_pickle; // Type and hotspots. - short_custom_pickle.WriteInt(0); + short_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); short_custom_pickle.WriteInt(0); short_custom_pickle.WriteInt(0); // X & Y @@ -49,7 +49,7 @@ TEST(WebCursorTest, CursorSerialization) { // This custom cursor has enough data but is too big. Pickle large_custom_pickle; // Type and hotspots. - large_custom_pickle.WriteInt(0); + large_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); large_custom_pickle.WriteInt(0); large_custom_pickle.WriteInt(0); // X & Y @@ -68,7 +68,7 @@ TEST(WebCursorTest, CursorSerialization) { // This custom cursor uses negative lengths. Pickle neg_custom_pickle; // Type and hotspots. - neg_custom_pickle.WriteInt(0); + neg_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); neg_custom_pickle.WriteInt(0); neg_custom_pickle.WriteInt(0); // X & Y @@ -81,6 +81,17 @@ TEST(WebCursorTest, CursorSerialization) { neg_custom_pickle.WriteUInt32(0); iter = NULL; EXPECT_FALSE(custom_cursor.Deserialize(&neg_custom_pickle, &iter)); + +#if defined(OS_WIN) + Pickle win32_custom_pickle; + WebCursor win32_custom_cursor; + win32_custom_cursor.InitFromExternalCursor( + reinterpret_cast<HCURSOR>(1000)); + EXPECT_TRUE(win32_custom_cursor.Serialize(&win32_custom_pickle)); + iter = NULL; + EXPECT_TRUE(custom_cursor.Deserialize(&win32_custom_pickle, &iter)); + EXPECT_EQ(reinterpret_cast<HCURSOR>(1000), custom_cursor.GetCursor(NULL)); +#endif // OS_WIN } TEST(WebCursorTest, ClampHotspot) { |