| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "ui/events/ozone/chromeos/cursor_controller.h" | 6 #include "ui/events/ozone/chromeos/cursor_controller.h" |
| 7 | 7 |
| 8 namespace ui { | 8 namespace ui { |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 const gfx::AcceleratedWidget kTestWindow = 1; | 12 const gfx::AcceleratedWidget kTestWindow = 1; |
| 13 | 13 |
| 14 } // namespace | 14 } // namespace |
| 15 | 15 |
| 16 class CursorControllerTest : public testing::Test { | 16 class CursorControllerTest : public testing::Test { |
| 17 public: | 17 public: |
| 18 CursorControllerTest() {} | 18 CursorControllerTest() {} |
| 19 virtual ~CursorControllerTest() {} | 19 ~CursorControllerTest() override {} |
| 20 | 20 |
| 21 void TearDown() override { | 21 void TearDown() override { |
| 22 ui::CursorController::GetInstance()->ClearCursorConfigForWindow( | 22 ui::CursorController::GetInstance()->ClearCursorConfigForWindow( |
| 23 kTestWindow); | 23 kTestWindow); |
| 24 } | 24 } |
| 25 | 25 |
| 26 DISALLOW_COPY_AND_ASSIGN(CursorControllerTest); | 26 DISALLOW_COPY_AND_ASSIGN(CursorControllerTest); |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 TEST_F(CursorControllerTest, UnconfiguredIdentity) { | 29 TEST_F(CursorControllerTest, UnconfiguredIdentity) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 // Check that 90deg rotated highdpi window transforms correctly. | 55 // Check that 90deg rotated highdpi window transforms correctly. |
| 56 cursor_controller->SetCursorConfigForWindow(kTestWindow, | 56 cursor_controller->SetCursorConfigForWindow(kTestWindow, |
| 57 gfx::Display::ROTATE_90, 2.f); | 57 gfx::Display::ROTATE_90, 2.f); |
| 58 gfx::Vector2dF delta(3.f, 5.f); | 58 gfx::Vector2dF delta(3.f, 5.f); |
| 59 cursor_controller->ApplyCursorConfigForWindow(kTestWindow, &delta); | 59 cursor_controller->ApplyCursorConfigForWindow(kTestWindow, &delta); |
| 60 EXPECT_FLOAT_EQ(-10.f, delta.x()); | 60 EXPECT_FLOAT_EQ(-10.f, delta.x()); |
| 61 EXPECT_FLOAT_EQ(6.f, delta.y()); | 61 EXPECT_FLOAT_EQ(6.f, delta.y()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace ui | 64 } // namespace ui |
| OLD | NEW |