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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 float velocity_x_ordinal() const { return velocity_x_ordinal_; } | 198 float velocity_x_ordinal() const { return velocity_x_ordinal_; } |
199 float velocity_y_ordinal() const { return velocity_y_ordinal_; } | 199 float velocity_y_ordinal() const { return velocity_y_ordinal_; } |
200 float scroll_x_hint() const { return scroll_x_hint_; } | 200 float scroll_x_hint() const { return scroll_x_hint_; } |
201 float scroll_y_hint() const { return scroll_y_hint_; } | 201 float scroll_y_hint() const { return scroll_y_hint_; } |
202 int touch_id() const { return touch_id_; } | 202 int touch_id() const { return touch_id_; } |
203 const gfx::Rect& bounding_box() const { return bounding_box_; } | 203 const gfx::Rect& bounding_box() const { return bounding_box_; } |
204 int tap_count() const { return tap_count_; } | 204 int tap_count() const { return tap_count_; } |
205 | 205 |
206 void WaitUntilReceivedGesture(ui::EventType type) { | 206 void WaitUntilReceivedGesture(ui::EventType type) { |
207 wait_until_event_ = type; | 207 wait_until_event_ = type; |
208 run_loop_.reset(new base::RunLoop( | 208 run_loop_.reset(new base::RunLoop()); |
209 Env::GetInstance()->GetDispatcher())); | |
210 run_loop_->Run(); | 209 run_loop_->Run(); |
211 } | 210 } |
212 | 211 |
213 virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE { | 212 virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE { |
214 events_.push_back(gesture->type()); | 213 events_.push_back(gesture->type()); |
215 bounding_box_ = gesture->details().bounding_box(); | 214 bounding_box_ = gesture->details().bounding_box(); |
216 switch (gesture->type()) { | 215 switch (gesture->type()) { |
217 case ui::ET_GESTURE_TAP: | 216 case ui::ET_GESTURE_TAP: |
218 tap_location_ = gesture->location(); | 217 tap_location_ = gesture->location(); |
219 tap_count_ = gesture->details().tap_count(); | 218 tap_count_ = gesture->details().tap_count(); |
(...skipping 3814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4034 EXPECT_FALSE(delegate->scroll_begin()); | 4033 EXPECT_FALSE(delegate->scroll_begin()); |
4035 EXPECT_TRUE(delegate->scroll_update()); | 4034 EXPECT_TRUE(delegate->scroll_update()); |
4036 EXPECT_EQ(1, delegate->scroll_x()); | 4035 EXPECT_EQ(1, delegate->scroll_x()); |
4037 EXPECT_EQ(0, delegate->scroll_x_hint()); | 4036 EXPECT_EQ(0, delegate->scroll_x_hint()); |
4038 delegate->Reset(); | 4037 delegate->Reset(); |
4039 | 4038 |
4040 } | 4039 } |
4041 | 4040 |
4042 } // namespace test | 4041 } // namespace test |
4043 } // namespace aura | 4042 } // namespace aura |
OLD | NEW |