Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 1841053002: Fix mouse wheel scrolling on PDFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 4090 matching lines...) Expand 10 before | Expand all | Expand 10 after
4101 // Simulates the mouse wheel event with no modifier applied. 4101 // Simulates the mouse wheel event with no modifier applied.
4102 event = ui::MouseWheelEvent(gfx::Vector2d(1, 1), gfx::Point(), gfx::Point(), 4102 event = ui::MouseWheelEvent(gfx::Vector2d(1, 1), gfx::Point(), gfx::Point(),
4103 ui::EventTimeForNow(), ui::EF_NONE, 0); 4103 ui::EventTimeForNow(), ui::EF_NONE, 0);
4104 4104
4105 view_->OnMouseEvent(&event); 4105 view_->OnMouseEvent(&event);
4106 4106
4107 input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0)); 4107 input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0));
4108 wheel_event = static_cast<const WebMouseWheelEvent*>(input_event); 4108 wheel_event = static_cast<const WebMouseWheelEvent*>(input_event);
4109 // Check if the canScroll set to true when no modifier is applied to the 4109 // Check if the canScroll set to true when no modifier is applied to the
4110 // mouse wheel event. 4110 // mouse wheel event.
4111 EXPECT_EQ(!UseGestureBasedWheelScrolling(), wheel_event->canScroll); 4111 EXPECT_TRUE(wheel_event->canScroll);
4112 sink_->ClearMessages(); 4112 sink_->ClearMessages();
4113 4113
4114 SendInputEventACK(blink::WebInputEvent::MouseWheel, 4114 SendInputEventACK(blink::WebInputEvent::MouseWheel,
4115 INPUT_EVENT_ACK_STATE_CONSUMED); 4115 INPUT_EVENT_ACK_STATE_CONSUMED);
4116 4116
4117 // Simulates the scroll event with ctrl modifier applied. 4117 // Simulates the scroll event with ctrl modifier applied.
4118 ui::ScrollEvent scroll(ui::ET_SCROLL, gfx::Point(2, 2), ui::EventTimeForNow(), 4118 ui::ScrollEvent scroll(ui::ET_SCROLL, gfx::Point(2, 2), ui::EventTimeForNow(),
4119 ui::EF_CONTROL_DOWN, 0, 5, 0, 5, 2); 4119 ui::EF_CONTROL_DOWN, 0, 5, 0, 5, 2);
4120 view_->OnScrollEvent(&scroll); 4120 view_->OnScrollEvent(&scroll);
4121 4121
4122 input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0)); 4122 input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0));
4123 wheel_event = static_cast<const WebMouseWheelEvent*>(input_event); 4123 wheel_event = static_cast<const WebMouseWheelEvent*>(input_event);
4124 // Check if the canScroll set to true when ctrl-touchpad-scroll is generated 4124 // Check if the canScroll set to true when ctrl-touchpad-scroll is generated
4125 // from scroll event. 4125 // from scroll event.
4126 EXPECT_EQ(!UseGestureBasedWheelScrolling(), wheel_event->canScroll); 4126 EXPECT_TRUE(wheel_event->canScroll);
4127 } 4127 }
4128 4128
4129 // Ensures that the mapping from ui::TouchEvent to blink::WebTouchEvent doesn't 4129 // Ensures that the mapping from ui::TouchEvent to blink::WebTouchEvent doesn't
4130 // lose track of the number of acks required. 4130 // lose track of the number of acks required.
4131 TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) { 4131 TEST_F(RenderWidgetHostViewAuraTest, CorrectNumberOfAcksAreDispatched) {
4132 view_->InitAsFullscreen(parent_view_); 4132 view_->InitAsFullscreen(parent_view_);
4133 view_->Show(); 4133 view_->Show();
4134 view_->UseFakeDispatcher(); 4134 view_->UseFakeDispatcher();
4135 4135
4136 ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0, 4136 ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(30, 30), 0,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4469 view()->OnGestureEvent(&gesture_event); 4469 view()->OnGestureEvent(&gesture_event);
4470 4470
4471 EXPECT_TRUE(delegate->context_menu_request_received()); 4471 EXPECT_TRUE(delegate->context_menu_request_received());
4472 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); 4472 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH);
4473 #endif 4473 #endif
4474 4474
4475 RenderViewHostFactory::set_is_real_render_view_host(false); 4475 RenderViewHostFactory::set_is_real_render_view_host(false);
4476 } 4476 }
4477 4477
4478 } // namespace content 4478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698