| 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "content/common/cursors/webcursor.h" | 10 #include "content/common/cursors/webcursor.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 WebCursor cursor; | 292 WebCursor cursor; |
| 293 cursor.SetDisplayInfo(display); | 293 cursor.SetDisplayInfo(display); |
| 294 cursor.InitFromCursorInfo(info); | 294 cursor.InitFromCursorInfo(info); |
| 295 | 295 |
| 296 HCURSOR windowsCursorHandle = cursor.GetPlatformCursor(); | 296 HCURSOR windowsCursorHandle = cursor.GetPlatformCursor(); |
| 297 EXPECT_NE(nullptr, windowsCursorHandle); | 297 EXPECT_NE(nullptr, windowsCursorHandle); |
| 298 ICONINFO windowsIconInfo; | 298 ICONINFO windowsIconInfo; |
| 299 EXPECT_TRUE(GetIconInfo(windowsCursorHandle, &windowsIconInfo)); | 299 EXPECT_TRUE(GetIconInfo(windowsCursorHandle, &windowsIconInfo)); |
| 300 EXPECT_FALSE(windowsIconInfo.fIcon); | 300 EXPECT_FALSE(windowsIconInfo.fIcon); |
| 301 EXPECT_EQ(static_cast<int>(scaleFactor * hotspotX), windowsIconInfo.xHotspot); | 301 EXPECT_EQ(static_cast<DWORD>(scaleFactor * hotspotX), |
| 302 EXPECT_EQ(static_cast<int>(scaleFactor * hotspotY), windowsIconInfo.yHotspot); | 302 windowsIconInfo.xHotspot); |
| 303 EXPECT_EQ(static_cast<DWORD>(scaleFactor * hotspotY), |
| 304 windowsIconInfo.yHotspot); |
| 303 } | 305 } |
| 304 | 306 |
| 305 TEST(WebCursorTest, WindowsCursorScaledAtHiDpi) { | 307 TEST(WebCursorTest, WindowsCursorScaledAtHiDpi) { |
| 306 ScaleCursor(2.0f, 4, 6); | 308 ScaleCursor(2.0f, 4, 6); |
| 307 ScaleCursor(1.5f, 2, 8); | 309 ScaleCursor(1.5f, 2, 8); |
| 308 ScaleCursor(1.25f, 3, 7); | 310 ScaleCursor(1.25f, 3, 7); |
| 309 } | 311 } |
| 310 #endif | 312 #endif |
| 311 | 313 |
| 312 } // namespace content | 314 } // namespace content |
| OLD | NEW |