OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/pickle.h" | 5 #include "base/pickle.h" |
| 6 #include "content/common/cursors/webcursor.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 8 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
8 #include "webkit/common/cursors/webcursor.h" | |
9 | 9 |
10 using blink::WebCursorInfo; | 10 using blink::WebCursorInfo; |
11 | 11 |
| 12 namespace content { |
| 13 |
12 TEST(WebCursorTest, OKCursorSerialization) { | 14 TEST(WebCursorTest, OKCursorSerialization) { |
13 WebCursor custom_cursor; | 15 WebCursor custom_cursor; |
14 // This is a valid custom cursor. | 16 // This is a valid custom cursor. |
15 Pickle ok_custom_pickle; | 17 Pickle ok_custom_pickle; |
16 // Type and hotspots. | 18 // Type and hotspots. |
17 ok_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); | 19 ok_custom_pickle.WriteInt(WebCursorInfo::TypeCustom); |
18 ok_custom_pickle.WriteInt(0); | 20 ok_custom_pickle.WriteInt(0); |
19 ok_custom_pickle.WriteInt(0); | 21 ok_custom_pickle.WriteInt(0); |
20 // X & Y | 22 // X & Y |
21 ok_custom_pickle.WriteInt(1); | 23 ok_custom_pickle.WriteInt(1); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 PickleIterator iter(ok_custom_pickle); | 223 PickleIterator iter(ok_custom_pickle); |
222 EXPECT_TRUE(custom_cursor.Deserialize(&iter)); | 224 EXPECT_TRUE(custom_cursor.Deserialize(&iter)); |
223 | 225 |
224 #if defined(TOOLKIT_GTK) | 226 #if defined(TOOLKIT_GTK) |
225 // On GTK+ using platforms, we should get a real native GdkCursor object back | 227 // On GTK+ using platforms, we should get a real native GdkCursor object back |
226 // (and the memory used should automatically be freed by the WebCursor object | 228 // (and the memory used should automatically be freed by the WebCursor object |
227 // for valgrind tests). | 229 // for valgrind tests). |
228 EXPECT_TRUE(custom_cursor.GetCustomCursor()); | 230 EXPECT_TRUE(custom_cursor.GetCustomCursor()); |
229 #endif | 231 #endif |
230 } | 232 } |
| 233 |
| 234 } // namespace content |
OLD | NEW |