| 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 "ui/chromeos/touch_exploration_controller.h" | 5 #include "ui/chromeos/touch_exploration_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 class TouchExplorationTest : public aura::test::AuraTestBase { | 189 class TouchExplorationTest : public aura::test::AuraTestBase { |
| 190 public: | 190 public: |
| 191 TouchExplorationTest() : simulated_clock_(new base::SimpleTestTickClock()) { | 191 TouchExplorationTest() : simulated_clock_(new base::SimpleTestTickClock()) { |
| 192 // Tests fail if time is ever 0. | 192 // Tests fail if time is ever 0. |
| 193 simulated_clock_->Advance(base::TimeDelta::FromMilliseconds(10)); | 193 simulated_clock_->Advance(base::TimeDelta::FromMilliseconds(10)); |
| 194 } | 194 } |
| 195 ~TouchExplorationTest() override {} | 195 ~TouchExplorationTest() override {} |
| 196 | 196 |
| 197 void SetUp() override { | 197 void SetUp() override { |
| 198 if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) | 198 if (gl::GetGLImplementation() == gl::kGLImplementationNone) |
| 199 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 199 gl::GLSurfaceTestSupport::InitializeOneOff(); |
| 200 aura::test::AuraTestBase::SetUp(); | 200 aura::test::AuraTestBase::SetUp(); |
| 201 cursor_client_.reset(new aura::test::TestCursorClient(root_window())); | 201 cursor_client_.reset(new aura::test::TestCursorClient(root_window())); |
| 202 root_window()->AddPreTargetHandler(&event_capturer_); | 202 root_window()->AddPreTargetHandler(&event_capturer_); |
| 203 generator_.reset(new test::EventGenerator(root_window())); | 203 generator_.reset(new test::EventGenerator(root_window())); |
| 204 // The generator takes ownership of the tick clock. | 204 // The generator takes ownership of the tick clock. |
| 205 generator_->SetTickClock( | 205 generator_->SetTickClock( |
| 206 std::unique_ptr<base::TickClock>(simulated_clock_)); | 206 std::unique_ptr<base::TickClock>(simulated_clock_)); |
| 207 cursor_client()->ShowCursor(); | 207 cursor_client()->ShowCursor(); |
| 208 cursor_client()->DisableMouseEvents(); | 208 cursor_client()->DisableMouseEvents(); |
| 209 } | 209 } |
| (...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 generator_->PressTouch(); | 1890 generator_->PressTouch(); |
| 1891 generator_->MoveTouch(initial_press); | 1891 generator_->MoveTouch(initial_press); |
| 1892 generator_->MoveTouch(*point); | 1892 generator_->MoveTouch(*point); |
| 1893 generator_->ReleaseTouch(); | 1893 generator_->ReleaseTouch(); |
| 1894 ASSERT_EQ(1U, delegate_.NumExitScreenSounds()); | 1894 ASSERT_EQ(1U, delegate_.NumExitScreenSounds()); |
| 1895 delegate_.ResetCountersToZero(); | 1895 delegate_.ResetCountersToZero(); |
| 1896 } | 1896 } |
| 1897 } | 1897 } |
| 1898 | 1898 |
| 1899 } // namespace ui | 1899 } // namespace ui |
| OLD | NEW |