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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 private: | 187 private: |
188 scoped_ptr<TouchExplorationController> touch_exploration_controller_; | 188 scoped_ptr<TouchExplorationController> touch_exploration_controller_; |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(TouchExplorationControllerTestApi); | 190 DISALLOW_COPY_AND_ASSIGN(TouchExplorationControllerTestApi); |
191 }; | 191 }; |
192 | 192 |
193 class TouchExplorationTest : public aura::test::AuraTestBase { | 193 class TouchExplorationTest : public aura::test::AuraTestBase { |
194 public: | 194 public: |
195 TouchExplorationTest() : simulated_clock_(new base::SimpleTestTickClock()) { | 195 TouchExplorationTest() |
196 // Tests fail if time is ever 0. | 196 : // Tests fail if time is ever 0. |
197 simulated_clock_->Advance(base::TimeDelta::FromMilliseconds(10)); | 197 simulated_clock_(new base::SimpleTestTickClock( |
198 } | 198 base::TimeTicks() + base::TimeDelta::FromMilliseconds(10))) {} |
199 ~TouchExplorationTest() override {} | 199 ~TouchExplorationTest() override {} |
200 | 200 |
201 void SetUp() override { | 201 void SetUp() override { |
202 if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) | 202 if (gfx::GetGLImplementation() == gfx::kGLImplementationNone) |
203 gfx::GLSurfaceTestSupport::InitializeOneOff(); | 203 gfx::GLSurfaceTestSupport::InitializeOneOff(); |
204 aura::test::AuraTestBase::SetUp(); | 204 aura::test::AuraTestBase::SetUp(); |
205 cursor_client_.reset(new aura::test::TestCursorClient(root_window())); | 205 cursor_client_.reset(new aura::test::TestCursorClient(root_window())); |
206 root_window()->AddPreTargetHandler(&event_capturer_); | 206 root_window()->AddPreTargetHandler(&event_capturer_); |
207 generator_.reset(new test::EventGenerator(root_window())); | 207 generator_.reset(new test::EventGenerator(root_window())); |
208 // The generator takes ownership of the tick clock. | 208 // The generator takes ownership of the tick clock. |
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 generator_->PressTouch(); | 1936 generator_->PressTouch(); |
1937 generator_->MoveTouch(initial_press); | 1937 generator_->MoveTouch(initial_press); |
1938 generator_->MoveTouch(*point); | 1938 generator_->MoveTouch(*point); |
1939 generator_->ReleaseTouch(); | 1939 generator_->ReleaseTouch(); |
1940 ASSERT_EQ(1U, delegate_.NumExitScreenSounds()); | 1940 ASSERT_EQ(1U, delegate_.NumExitScreenSounds()); |
1941 delegate_.ResetCountersToZero(); | 1941 delegate_.ResetCountersToZero(); |
1942 } | 1942 } |
1943 } | 1943 } |
1944 | 1944 |
1945 } // namespace ui | 1945 } // namespace ui |
OLD | NEW |