Chromium Code Reviews| Index: ash/laser/laser_pointer_points_unittest.cc |
| diff --git a/ash/laser/laser_pointer_controller_unittest.cc b/ash/laser/laser_pointer_points_unittest.cc |
| similarity index 54% |
| copy from ash/laser/laser_pointer_controller_unittest.cc |
| copy to ash/laser/laser_pointer_points_unittest.cc |
| index 84818c75a9e3ae94ca11008fe2a171199c880ee0..cbdfe67291dca9cf3515e907c81e68e9eb9ccdcc 100644 |
| --- a/ash/laser/laser_pointer_controller_unittest.cc |
| +++ b/ash/laser/laser_pointer_points_unittest.cc |
| @@ -2,11 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "ash/laser/laser_pointer_controller.h" |
| -#include "ash/laser/laser_pointer_controller_test_api.h" |
| #include "ash/laser/laser_pointer_points_test_api.h" |
|
James Cook
2017/01/19 22:10:16
nit: #include the file under test (laser_pointer_p
sammiequon
2017/01/20 00:00:38
Done.
|
| -#include "ash/laser/laser_pointer_view.h" |
| -#include "ash/shell.h" |
| #include "ash/test/ash_test_base.h" |
| #include "ui/events/test/event_generator.h" |
| @@ -15,8 +11,6 @@ namespace { |
| const int kTestPointsLifetimeSeconds = 5; |
| -// TODO(sammiequon): Move this test into a different file. See |
| -// http://crbug.com/646953. |
| class LaserPointerPointsTest : public test::AshTestBase { |
| public: |
| LaserPointerPointsTest() |
| @@ -31,30 +25,6 @@ class LaserPointerPointsTest : public test::AshTestBase { |
| DISALLOW_COPY_AND_ASSIGN(LaserPointerPointsTest); |
| }; |
| -class LaserPointerControllerTest : public test::AshTestBase { |
| - public: |
| - LaserPointerControllerTest() {} |
| - ~LaserPointerControllerTest() override {} |
| - |
| - void SetUp() override { |
| - AshTestBase::SetUp(); |
| - controller_.reset(new LaserPointerController()); |
| - } |
| - |
| - void TearDown() override { |
| - // This needs to be called first to remove the event handler before the |
| - // shell instance gets torn down. |
| - controller_.reset(); |
| - AshTestBase::TearDown(); |
| - } |
| - |
| - protected: |
| - std::unique_ptr<LaserPointerController> controller_; |
| - |
| - private: |
| - DISALLOW_COPY_AND_ASSIGN(LaserPointerControllerTest); |
| -}; |
| - |
| } // namespace |
| // Tests that the laser pointers internal collection handles receiving points |
| @@ -146,78 +116,4 @@ TEST_F(LaserPointerPointsTest, LaserPointerInternalCollectionDeletion) { |
| points_test_api_.MoveForwardInTime(base::TimeDelta::FromSeconds(3)); |
| EXPECT_EQ(3, points_test_api_.GetNumberOfPoints()); |
| } |
| - |
| -// Test to ensure the class responsible for drawing the laser pointer receives |
| -// points from stylus movements as expected. |
| -TEST_F(LaserPointerControllerTest, LaserPointerRenderer) { |
| - LaserPointerControllerTestApi controller_test_api_(controller_.get()); |
| - |
| - // The laser pointer mode only works with stylus. |
| - GetEventGenerator().EnterPenPointerMode(); |
| - |
| - // When disabled the laser pointer should not be showing. |
| - GetEventGenerator().MoveTouch(gfx::Point(1, 1)); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify that by enabling the mode, the laser pointer should still not be |
| - // showing. |
| - controller_test_api_.SetEnabled(true); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify moving the stylus 4 times will not display the laser pointer. |
| - GetEventGenerator().MoveTouch(gfx::Point(2, 2)); |
| - GetEventGenerator().MoveTouch(gfx::Point(3, 3)); |
| - GetEventGenerator().MoveTouch(gfx::Point(4, 4)); |
| - GetEventGenerator().MoveTouch(gfx::Point(5, 5)); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify pressing the stylus will show the laser pointer and add a point but |
| - // will not activate fading out. |
| - GetEventGenerator().PressTouch(); |
| - EXPECT_TRUE(controller_test_api_.IsShowingLaserPointer()); |
| - EXPECT_FALSE(controller_test_api_.IsFadingAway()); |
| - EXPECT_EQ(1, controller_test_api_.laser_points().GetNumberOfPoints()); |
| - |
| - // Verify dragging the stylus 2 times will add 2 more points. |
| - GetEventGenerator().MoveTouch(gfx::Point(6, 6)); |
| - GetEventGenerator().MoveTouch(gfx::Point(7, 7)); |
| - EXPECT_EQ(3, controller_test_api_.laser_points().GetNumberOfPoints()); |
| - |
| - // Verify releasing the stylus still shows the laser pointer, which is fading |
| - // away. |
| - GetEventGenerator().ReleaseTouch(); |
| - EXPECT_TRUE(controller_test_api_.IsShowingLaserPointer()); |
| - EXPECT_TRUE(controller_test_api_.IsFadingAway()); |
| - |
| - // Verify that disabling the mode does not display the laser pointer. |
| - controller_test_api_.SetEnabled(false); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify that disabling the mode while laser pointer is displayed does not |
| - // display the laser pointer. |
| - controller_test_api_.SetIsFadingAway(false); |
| - controller_test_api_.SetEnabled(true); |
| - GetEventGenerator().PressTouch(); |
| - GetEventGenerator().MoveTouch(gfx::Point(6, 6)); |
| - EXPECT_TRUE(controller_test_api_.IsShowingLaserPointer()); |
| - controller_test_api_.SetEnabled(false); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify that the laser pointer does not add points while disabled. |
| - GetEventGenerator().PressTouch(); |
| - GetEventGenerator().MoveTouch(gfx::Point(8, 8)); |
| - GetEventGenerator().ReleaseTouch(); |
| - GetEventGenerator().MoveTouch(gfx::Point(9, 9)); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - |
| - // Verify that the laser pointer does not get shown if points are not coming |
| - // from the stylus, even when enabled. |
| - GetEventGenerator().ExitPenPointerMode(); |
| - controller_test_api_.SetEnabled(true); |
| - GetEventGenerator().PressTouch(); |
| - GetEventGenerator().MoveTouch(gfx::Point(10, 10)); |
| - GetEventGenerator().MoveTouch(gfx::Point(11, 11)); |
| - EXPECT_FALSE(controller_test_api_.IsShowingLaserPointer()); |
| - GetEventGenerator().ReleaseTouch(); |
| -} |
| } // namespace ash |