| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/test/content_browser_test.h" | 37 #include "content/public/test/content_browser_test.h" |
| 38 #include "content/public/test/content_browser_test_utils.h" | 38 #include "content/public/test/content_browser_test_utils.h" |
| 39 #include "content/public/test/test_renderer_host.h" | 39 #include "content/public/test/test_renderer_host.h" |
| 40 #include "content/public/test/test_utils.h" | 40 #include "content/public/test/test_utils.h" |
| 41 #include "content/shell/browser/shell.h" | 41 #include "content/shell/browser/shell.h" |
| 42 #include "net/test/embedded_test_server/embedded_test_server.h" | 42 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 43 #include "ui/aura/window.h" | 43 #include "ui/aura/window.h" |
| 44 #include "ui/aura/window_tree_host.h" | 44 #include "ui/aura/window_tree_host.h" |
| 45 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 45 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 46 #include "ui/events/base_event_utils.h" | 46 #include "ui/events/base_event_utils.h" |
| 47 #include "ui/events/event_processor.h" | 47 #include "ui/events/event_sink.h" |
| 48 #include "ui/events/event_utils.h" | 48 #include "ui/events/event_utils.h" |
| 49 #include "ui/events/test/event_generator.h" | 49 #include "ui/events/test/event_generator.h" |
| 50 | 50 |
| 51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
| 52 #include "base/win/windows_version.h" | 52 #include "base/win/windows_version.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 // TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282 | 57 // TODO(tdresser): Find a way to avoid sleeping like this. See crbug.com/405282 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 | 453 |
| 454 // Make sure the page has both back/forward history. | 454 // Make sure the page has both back/forward history. |
| 455 ExecuteSyncJSFunction(main_frame, "navigate_next()"); | 455 ExecuteSyncJSFunction(main_frame, "navigate_next()"); |
| 456 EXPECT_EQ(1, GetCurrentIndex()); | 456 EXPECT_EQ(1, GetCurrentIndex()); |
| 457 ExecuteSyncJSFunction(main_frame, "navigate_next()"); | 457 ExecuteSyncJSFunction(main_frame, "navigate_next()"); |
| 458 EXPECT_EQ(2, GetCurrentIndex()); | 458 EXPECT_EQ(2, GetCurrentIndex()); |
| 459 web_contents->GetController().GoBack(); | 459 web_contents->GetController().GoBack(); |
| 460 EXPECT_EQ(1, GetCurrentIndex()); | 460 EXPECT_EQ(1, GetCurrentIndex()); |
| 461 | 461 |
| 462 aura::Window* content = web_contents->GetContentNativeView(); | 462 aura::Window* content = web_contents->GetContentNativeView(); |
| 463 ui::EventProcessor* dispatcher = content->GetHost()->event_processor(); | 463 ui::EventSink* sink = content->GetHost()->event_sink(); |
| 464 gfx::Rect bounds = content->GetBoundsInRootWindow(); | 464 gfx::Rect bounds = content->GetBoundsInRootWindow(); |
| 465 | 465 |
| 466 base::TimeTicks timestamp = ui::EventTimeForNow(); | 466 base::TimeTicks timestamp = ui::EventTimeForNow(); |
| 467 ui::TouchEvent press( | 467 ui::TouchEvent press( |
| 468 ui::ET_TOUCH_PRESSED, | 468 ui::ET_TOUCH_PRESSED, |
| 469 gfx::Point(bounds.x() + bounds.width() / 2, bounds.y() + 5), timestamp, | 469 gfx::Point(bounds.x() + bounds.width() / 2, bounds.y() + 5), timestamp, |
| 470 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 470 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 471 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 471 ui::EventDispatchDetails details = sink->OnEventFromSource(&press); |
| 472 ASSERT_FALSE(details.dispatcher_destroyed); | 472 ASSERT_FALSE(details.dispatcher_destroyed); |
| 473 EXPECT_EQ(1, GetCurrentIndex()); | 473 EXPECT_EQ(1, GetCurrentIndex()); |
| 474 | 474 |
| 475 timestamp += base::TimeDelta::FromMilliseconds(10); | 475 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 476 ui::TouchEvent move1( | 476 ui::TouchEvent move1( |
| 477 ui::ET_TOUCH_MOVED, gfx::Point(bounds.right() - 10, bounds.y() + 5), | 477 ui::ET_TOUCH_MOVED, gfx::Point(bounds.right() - 10, bounds.y() + 5), |
| 478 timestamp, | 478 timestamp, |
| 479 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 479 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 480 details = dispatcher->OnEventFromSource(&move1); | 480 details = sink->OnEventFromSource(&move1); |
| 481 ASSERT_FALSE(details.dispatcher_destroyed); | 481 ASSERT_FALSE(details.dispatcher_destroyed); |
| 482 EXPECT_EQ(1, GetCurrentIndex()); | 482 EXPECT_EQ(1, GetCurrentIndex()); |
| 483 | 483 |
| 484 // Swipe back from the right edge, back to the left edge, back to the right | 484 // Swipe back from the right edge, back to the left edge, back to the right |
| 485 // edge. | 485 // edge. |
| 486 | 486 |
| 487 for (int x = bounds.right() - 10; x >= bounds.x() + 10; x-= 10) { | 487 for (int x = bounds.right() - 10; x >= bounds.x() + 10; x-= 10) { |
| 488 timestamp += base::TimeDelta::FromMilliseconds(10); | 488 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 489 ui::TouchEvent inc( | 489 ui::TouchEvent inc( |
| 490 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, | 490 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, |
| 491 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 491 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 492 details = dispatcher->OnEventFromSource(&inc); | 492 details = sink->OnEventFromSource(&inc); |
| 493 ASSERT_FALSE(details.dispatcher_destroyed); | 493 ASSERT_FALSE(details.dispatcher_destroyed); |
| 494 EXPECT_EQ(1, GetCurrentIndex()); | 494 EXPECT_EQ(1, GetCurrentIndex()); |
| 495 } | 495 } |
| 496 | 496 |
| 497 for (int x = bounds.x() + 10; x <= bounds.width() - 10; x+= 10) { | 497 for (int x = bounds.x() + 10; x <= bounds.width() - 10; x+= 10) { |
| 498 timestamp += base::TimeDelta::FromMilliseconds(10); | 498 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 499 ui::TouchEvent inc( | 499 ui::TouchEvent inc( |
| 500 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, | 500 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, |
| 501 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 501 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 502 details = dispatcher->OnEventFromSource(&inc); | 502 details = sink->OnEventFromSource(&inc); |
| 503 ASSERT_FALSE(details.dispatcher_destroyed); | 503 ASSERT_FALSE(details.dispatcher_destroyed); |
| 504 EXPECT_EQ(1, GetCurrentIndex()); | 504 EXPECT_EQ(1, GetCurrentIndex()); |
| 505 } | 505 } |
| 506 | 506 |
| 507 for (int x = bounds.width() - 10; x >= bounds.x() + 10; x-= 10) { | 507 for (int x = bounds.width() - 10; x >= bounds.x() + 10; x-= 10) { |
| 508 timestamp += base::TimeDelta::FromMilliseconds(10); | 508 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 509 ui::TouchEvent inc( | 509 ui::TouchEvent inc( |
| 510 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, | 510 ui::ET_TOUCH_MOVED, gfx::Point(x, bounds.y() + 5), timestamp, |
| 511 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 511 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 512 details = dispatcher->OnEventFromSource(&inc); | 512 details = sink->OnEventFromSource(&inc); |
| 513 ASSERT_FALSE(details.dispatcher_destroyed); | 513 ASSERT_FALSE(details.dispatcher_destroyed); |
| 514 EXPECT_EQ(1, GetCurrentIndex()); | 514 EXPECT_EQ(1, GetCurrentIndex()); |
| 515 } | 515 } |
| 516 | 516 |
| 517 // Do not end the overscroll sequence. | 517 // Do not end the overscroll sequence. |
| 518 } | 518 } |
| 519 | 519 |
| 520 // Tests that the page has has a screenshot when navigation happens: | 520 // Tests that the page has has a screenshot when navigation happens: |
| 521 // - from within the page (from a JS function) | 521 // - from within the page (from a JS function) |
| 522 // - interactively, when user does an overscroll gesture | 522 // - interactively, when user does an overscroll gesture |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 static_cast<WebContentsImpl*>(shell()->web_contents()); | 990 static_cast<WebContentsImpl*>(shell()->web_contents()); |
| 991 VerticalOverscrollTracker tracker; | 991 VerticalOverscrollTracker tracker; |
| 992 web_contents->SetDelegate(&tracker); | 992 web_contents->SetDelegate(&tracker); |
| 993 | 993 |
| 994 // This test triggers a large number of animations. Speed them up to ensure | 994 // This test triggers a large number of animations. Speed them up to ensure |
| 995 // the test completes within its time limit. | 995 // the test completes within its time limit. |
| 996 ui::ScopedAnimationDurationScaleMode fast_duration_mode( | 996 ui::ScopedAnimationDurationScaleMode fast_duration_mode( |
| 997 ui::ScopedAnimationDurationScaleMode::FAST_DURATION); | 997 ui::ScopedAnimationDurationScaleMode::FAST_DURATION); |
| 998 | 998 |
| 999 aura::Window* content = web_contents->GetContentNativeView(); | 999 aura::Window* content = web_contents->GetContentNativeView(); |
| 1000 ui::EventProcessor* dispatcher = content->GetHost()->event_processor(); | 1000 ui::EventSink* sink = content->GetHost()->event_sink(); |
| 1001 gfx::Rect bounds = content->GetBoundsInRootWindow(); | 1001 gfx::Rect bounds = content->GetBoundsInRootWindow(); |
| 1002 | 1002 |
| 1003 // Overscroll horizontally. | 1003 // Overscroll horizontally. |
| 1004 { | 1004 { |
| 1005 int kXStep = bounds.width() / 10; | 1005 int kXStep = bounds.width() / 10; |
| 1006 gfx::Point location(bounds.right() - kXStep, bounds.y() + 5); | 1006 gfx::Point location(bounds.right() - kXStep, bounds.y() + 5); |
| 1007 base::TimeTicks timestamp = ui::EventTimeForNow(); | 1007 base::TimeTicks timestamp = ui::EventTimeForNow(); |
| 1008 ui::TouchEvent press( | 1008 ui::TouchEvent press( |
| 1009 ui::ET_TOUCH_PRESSED, location, timestamp, | 1009 ui::ET_TOUCH_PRESSED, location, timestamp, |
| 1010 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1010 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1011 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 1011 ui::EventDispatchDetails details = sink->OnEventFromSource(&press); |
| 1012 ASSERT_FALSE(details.dispatcher_destroyed); | 1012 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1013 WaitAFrame(); | 1013 WaitAFrame(); |
| 1014 location -= gfx::Vector2d(kXStep, 0); | 1014 location -= gfx::Vector2d(kXStep, 0); |
| 1015 timestamp += base::TimeDelta::FromMilliseconds(10); | 1015 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1016 | 1016 |
| 1017 while (location.x() > bounds.x() + kXStep) { | 1017 while (location.x() > bounds.x() + kXStep) { |
| 1018 ui::TouchEvent inc( | 1018 ui::TouchEvent inc( |
| 1019 ui::ET_TOUCH_MOVED, location, timestamp, | 1019 ui::ET_TOUCH_MOVED, location, timestamp, |
| 1020 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1020 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1021 details = dispatcher->OnEventFromSource(&inc); | 1021 details = sink->OnEventFromSource(&inc); |
| 1022 ASSERT_FALSE(details.dispatcher_destroyed); | 1022 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1023 WaitAFrame(); | 1023 WaitAFrame(); |
| 1024 location -= gfx::Vector2d(10, 0); | 1024 location -= gfx::Vector2d(10, 0); |
| 1025 timestamp += base::TimeDelta::FromMilliseconds(10); | 1025 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 ui::TouchEvent release( | 1028 ui::TouchEvent release( |
| 1029 ui::ET_TOUCH_RELEASED, location, timestamp, | 1029 ui::ET_TOUCH_RELEASED, location, timestamp, |
| 1030 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1030 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1031 details = dispatcher->OnEventFromSource(&release); | 1031 details = sink->OnEventFromSource(&release); |
| 1032 ASSERT_FALSE(details.dispatcher_destroyed); | 1032 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1033 WaitAFrame(); | 1033 WaitAFrame(); |
| 1034 | 1034 |
| 1035 EXPECT_EQ(0, tracker.num_overscroll_updates()); | 1035 EXPECT_EQ(0, tracker.num_overscroll_updates()); |
| 1036 EXPECT_FALSE(tracker.overscroll_completed()); | 1036 EXPECT_FALSE(tracker.overscroll_completed()); |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 // Overscroll vertically. | 1039 // Overscroll vertically. |
| 1040 { | 1040 { |
| 1041 tracker.Reset(); | 1041 tracker.Reset(); |
| 1042 | 1042 |
| 1043 int kYStep = bounds.height() / 10; | 1043 int kYStep = bounds.height() / 10; |
| 1044 gfx::Point location(bounds.x() + 10, bounds.y() + kYStep); | 1044 gfx::Point location(bounds.x() + 10, bounds.y() + kYStep); |
| 1045 base::TimeTicks timestamp = ui::EventTimeForNow(); | 1045 base::TimeTicks timestamp = ui::EventTimeForNow(); |
| 1046 ui::TouchEvent press( | 1046 ui::TouchEvent press( |
| 1047 ui::ET_TOUCH_PRESSED, location, timestamp, | 1047 ui::ET_TOUCH_PRESSED, location, timestamp, |
| 1048 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1048 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1049 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 1049 ui::EventDispatchDetails details = sink->OnEventFromSource(&press); |
| 1050 ASSERT_FALSE(details.dispatcher_destroyed); | 1050 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1051 WaitAFrame(); | 1051 WaitAFrame(); |
| 1052 location += gfx::Vector2d(0, kYStep); | 1052 location += gfx::Vector2d(0, kYStep); |
| 1053 timestamp += base::TimeDelta::FromMilliseconds(10); | 1053 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1054 | 1054 |
| 1055 while (location.y() < bounds.bottom() - kYStep) { | 1055 while (location.y() < bounds.bottom() - kYStep) { |
| 1056 ui::TouchEvent inc( | 1056 ui::TouchEvent inc( |
| 1057 ui::ET_TOUCH_MOVED, location, timestamp, | 1057 ui::ET_TOUCH_MOVED, location, timestamp, |
| 1058 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1058 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1059 details = dispatcher->OnEventFromSource(&inc); | 1059 details = sink->OnEventFromSource(&inc); |
| 1060 ASSERT_FALSE(details.dispatcher_destroyed); | 1060 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1061 WaitAFrame(); | 1061 WaitAFrame(); |
| 1062 location += gfx::Vector2d(0, kYStep); | 1062 location += gfx::Vector2d(0, kYStep); |
| 1063 timestamp += base::TimeDelta::FromMilliseconds(10); | 1063 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 ui::TouchEvent release( | 1066 ui::TouchEvent release( |
| 1067 ui::ET_TOUCH_RELEASED, location, timestamp, | 1067 ui::ET_TOUCH_RELEASED, location, timestamp, |
| 1068 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1068 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1069 details = dispatcher->OnEventFromSource(&release); | 1069 details = sink->OnEventFromSource(&release); |
| 1070 ASSERT_FALSE(details.dispatcher_destroyed); | 1070 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1071 WaitAFrame(); | 1071 WaitAFrame(); |
| 1072 | 1072 |
| 1073 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1073 EXPECT_LT(0, tracker.num_overscroll_updates()); |
| 1074 EXPECT_TRUE(tracker.overscroll_completed()); | 1074 EXPECT_TRUE(tracker.overscroll_completed()); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 // Start out overscrolling vertically, then switch directions and finish | 1077 // Start out overscrolling vertically, then switch directions and finish |
| 1078 // overscrolling horizontally. | 1078 // overscrolling horizontally. |
| 1079 { | 1079 { |
| 1080 tracker.Reset(); | 1080 tracker.Reset(); |
| 1081 | 1081 |
| 1082 int kXStep = bounds.width() / 10; | 1082 int kXStep = bounds.width() / 10; |
| 1083 int kYStep = bounds.height() / 10; | 1083 int kYStep = bounds.height() / 10; |
| 1084 gfx::Point location = bounds.origin() + gfx::Vector2d(0, kYStep); | 1084 gfx::Point location = bounds.origin() + gfx::Vector2d(0, kYStep); |
| 1085 base::TimeTicks timestamp = ui::EventTimeForNow(); | 1085 base::TimeTicks timestamp = ui::EventTimeForNow(); |
| 1086 ui::TouchEvent press( | 1086 ui::TouchEvent press( |
| 1087 ui::ET_TOUCH_PRESSED, location, timestamp, | 1087 ui::ET_TOUCH_PRESSED, location, timestamp, |
| 1088 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1088 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1089 ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&press); | 1089 ui::EventDispatchDetails details = sink->OnEventFromSource(&press); |
| 1090 ASSERT_FALSE(details.dispatcher_destroyed); | 1090 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1091 WaitAFrame(); | 1091 WaitAFrame(); |
| 1092 location += gfx::Vector2d(0, kYStep); | 1092 location += gfx::Vector2d(0, kYStep); |
| 1093 timestamp += base::TimeDelta::FromMilliseconds(10); | 1093 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1094 | 1094 |
| 1095 for (size_t i = 0; i < 3; ++i) { | 1095 for (size_t i = 0; i < 3; ++i) { |
| 1096 ui::TouchEvent inc( | 1096 ui::TouchEvent inc( |
| 1097 ui::ET_TOUCH_MOVED, location, timestamp, | 1097 ui::ET_TOUCH_MOVED, location, timestamp, |
| 1098 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1098 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1099 details = dispatcher->OnEventFromSource(&inc); | 1099 details = sink->OnEventFromSource(&inc); |
| 1100 ASSERT_FALSE(details.dispatcher_destroyed); | 1100 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1101 WaitAFrame(); | 1101 WaitAFrame(); |
| 1102 location += gfx::Vector2d(0, kYStep); | 1102 location += gfx::Vector2d(0, kYStep); |
| 1103 timestamp += base::TimeDelta::FromMilliseconds(10); | 1103 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 while (location.x() < bounds.right() - kXStep) { | 1106 while (location.x() < bounds.right() - kXStep) { |
| 1107 ui::TouchEvent inc( | 1107 ui::TouchEvent inc( |
| 1108 ui::ET_TOUCH_MOVED, location, timestamp, | 1108 ui::ET_TOUCH_MOVED, location, timestamp, |
| 1109 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1109 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1110 details = dispatcher->OnEventFromSource(&inc); | 1110 details = sink->OnEventFromSource(&inc); |
| 1111 ASSERT_FALSE(details.dispatcher_destroyed); | 1111 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1112 WaitAFrame(); | 1112 WaitAFrame(); |
| 1113 location += gfx::Vector2d(kXStep, 0); | 1113 location += gfx::Vector2d(kXStep, 0); |
| 1114 timestamp += base::TimeDelta::FromMilliseconds(10); | 1114 timestamp += base::TimeDelta::FromMilliseconds(10); |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 ui::TouchEvent release( | 1117 ui::TouchEvent release( |
| 1118 ui::ET_TOUCH_RELEASED, location, timestamp, | 1118 ui::ET_TOUCH_RELEASED, location, timestamp, |
| 1119 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); | 1119 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 0)); |
| 1120 details = dispatcher->OnEventFromSource(&release); | 1120 details = sink->OnEventFromSource(&release); |
| 1121 ASSERT_FALSE(details.dispatcher_destroyed); | 1121 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1122 WaitAFrame(); | 1122 WaitAFrame(); |
| 1123 | 1123 |
| 1124 EXPECT_LT(0, tracker.num_overscroll_updates()); | 1124 EXPECT_LT(0, tracker.num_overscroll_updates()); |
| 1125 EXPECT_FALSE(tracker.overscroll_completed()); | 1125 EXPECT_FALSE(tracker.overscroll_completed()); |
| 1126 } | 1126 } |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 } // namespace content | 1129 } // namespace content |
| OLD | NEW |