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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 while (location.x() > bounds.x() + kXStep) { | 1052 while (location.x() > bounds.x() + kXStep) { |
1053 ui::TouchEvent inc(ui::ET_TOUCH_MOVED, location, 0, timestamp); | 1053 ui::TouchEvent inc(ui::ET_TOUCH_MOVED, location, 0, timestamp); |
1054 details = dispatcher->OnEventFromSource(&inc); | 1054 details = dispatcher->OnEventFromSource(&inc); |
1055 ASSERT_FALSE(details.dispatcher_destroyed); | 1055 ASSERT_FALSE(details.dispatcher_destroyed); |
1056 WaitAFrame(); | 1056 WaitAFrame(); |
1057 location -= gfx::Vector2d(10, 0); | 1057 location -= gfx::Vector2d(10, 0); |
1058 timestamp += base::TimeDelta::FromMilliseconds(10); | 1058 timestamp += base::TimeDelta::FromMilliseconds(10); |
1059 } | 1059 } |
1060 | 1060 |
1061 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, location, 0, timestamp); | 1061 ui::TouchEvent release(ui::ET_TOUCH_RELEASED, location, 0, timestamp); |
1062 details = dispatcher->OnEventFromSource(&press); | 1062 details = dispatcher->OnEventFromSource(&release); |
1063 ASSERT_FALSE(details.dispatcher_destroyed); | 1063 ASSERT_FALSE(details.dispatcher_destroyed); |
1064 WaitAFrame(); | 1064 WaitAFrame(); |
1065 | 1065 |
1066 EXPECT_EQ(0, tracker.num_overscroll_updates()); | 1066 EXPECT_EQ(0, tracker.num_overscroll_updates()); |
1067 EXPECT_FALSE(tracker.overscroll_completed()); | 1067 EXPECT_FALSE(tracker.overscroll_completed()); |
1068 } | 1068 } |
1069 | 1069 |
1070 // Overscroll vertically. | 1070 // Overscroll vertically. |
1071 { | 1071 { |
1072 tracker.Reset(); | 1072 tracker.Reset(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 details = dispatcher->OnEventFromSource(&release); | 1145 details = dispatcher->OnEventFromSource(&release); |
1146 ASSERT_FALSE(details.dispatcher_destroyed); | 1146 ASSERT_FALSE(details.dispatcher_destroyed); |
1147 WaitAFrame(); | 1147 WaitAFrame(); |
1148 | 1148 |
1149 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1149 EXPECT_LT(0, tracker.num_overscroll_updates()); |
1150 EXPECT_FALSE(tracker.overscroll_completed()); | 1150 EXPECT_FALSE(tracker.overscroll_completed()); |
1151 } | 1151 } |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace content | 1154 } // namespace content |
OLD | NEW |