| 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 "ash/wm/ash_native_cursor_manager.h" | 5 #include "ash/wm/ash_native_cursor_manager.h" |
| 6 | 6 |
| 7 #include "ash/display/display_info.h" | 7 #include "ash/display/display_info.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/display/display_util.h" | 9 #include "ash/display/display_util.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 TEST_F(AshNativeCursorManagerTest, FractionalScale) { | 152 TEST_F(AshNativeCursorManagerTest, FractionalScale) { |
| 153 ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); | 153 ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); |
| 154 CursorManagerTestApi test_api(cursor_manager); | 154 CursorManagerTestApi test_api(cursor_manager); |
| 155 // Cursor should use the resource scale factor. | 155 // Cursor should use the resource scale factor. |
| 156 UpdateDisplay("800x100*1.25"); | 156 UpdateDisplay("800x100*1.25"); |
| 157 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); | 157 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); |
| 158 } | 158 } |
| 159 #endif | 159 #endif |
| 160 | 160 |
| 161 TEST_F(AshNativeCursorManagerTest, UIScaleShouldNotChangeCursor) { | 161 TEST_F(AshNativeCursorManagerTest, UIScaleShouldNotChangeCursor) { |
| 162 int64 display_id = Shell::GetScreen()->GetPrimaryDisplay().id(); | 162 int64_t display_id = Shell::GetScreen()->GetPrimaryDisplay().id(); |
| 163 gfx::Display::SetInternalDisplayId(display_id); | 163 gfx::Display::SetInternalDisplayId(display_id); |
| 164 | 164 |
| 165 ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); | 165 ::wm::CursorManager* cursor_manager = Shell::GetInstance()->cursor_manager(); |
| 166 CursorManagerTestApi test_api(cursor_manager); | 166 CursorManagerTestApi test_api(cursor_manager); |
| 167 | 167 |
| 168 SetDisplayUIScale(display_id, 0.5f); | 168 SetDisplayUIScale(display_id, 0.5f); |
| 169 EXPECT_EQ(1.0f, | 169 EXPECT_EQ(1.0f, |
| 170 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); | 170 Shell::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
| 171 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); | 171 EXPECT_EQ(1.0f, test_api.GetCurrentCursor().device_scale_factor()); |
| 172 | 172 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 201 loader.set_scale(2.0f); | 201 loader.set_scale(2.0f); |
| 202 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point()); | 202 loader.LoadImageCursor(kCursorId, IDR_AURA_CURSOR_MOVE, gfx::Point()); |
| 203 image = loader.GetXcursorImageForTest(kCursorId); | 203 image = loader.GetXcursorImageForTest(kCursorId); |
| 204 EXPECT_EQ(height * 2, static_cast<int>(image->height)); | 204 EXPECT_EQ(height * 2, static_cast<int>(image->height)); |
| 205 EXPECT_EQ(width * 2, static_cast<int>(image->width)); | 205 EXPECT_EQ(width * 2, static_cast<int>(image->width)); |
| 206 } | 206 } |
| 207 #endif | 207 #endif |
| 208 | 208 |
| 209 } // namespace test | 209 } // namespace test |
| 210 } // namespace ash | 210 } // namespace ash |
| OLD | NEW |