| 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/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 3925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3936 SimulateGestureEvent(WebInputEvent::GestureScrollBegin, | 3936 SimulateGestureEvent(WebInputEvent::GestureScrollBegin, |
| 3937 blink::WebGestureDeviceTouchscreen); | 3937 blink::WebGestureDeviceTouchscreen); |
| 3938 SimulateGestureFlingStartEvent(0.f, 0.f, blink::WebGestureDeviceTouchpad); | 3938 SimulateGestureFlingStartEvent(0.f, 0.f, blink::WebGestureDeviceTouchpad); |
| 3939 EXPECT_TRUE(ScrollStateIsUnknown()); | 3939 EXPECT_TRUE(ScrollStateIsUnknown()); |
| 3940 EXPECT_EQ(1U, sink_->message_count()); | 3940 EXPECT_EQ(1U, sink_->message_count()); |
| 3941 | 3941 |
| 3942 // Dropped flings should neither propagate *nor* indicate that they were | 3942 // Dropped flings should neither propagate *nor* indicate that they were |
| 3943 // consumed and have triggered a fling animation (as tracked by the router). | 3943 // consumed and have triggered a fling animation (as tracked by the router). |
| 3944 EXPECT_FALSE(parent_host_->input_router()->HasPendingEvents()); | 3944 EXPECT_FALSE(parent_host_->input_router()->HasPendingEvents()); |
| 3945 | 3945 |
| 3946 SimulateGestureEvent(WebInputEvent::GestureScrollEnd, |
| 3947 blink::WebGestureDeviceTouchscreen); |
| 3948 |
| 3946 SimulateWheelEvent(-5, 0, 0, true); // sent directly | 3949 SimulateWheelEvent(-5, 0, 0, true); // sent directly |
| 3947 SimulateWheelEvent(-60, 0, 0, true); // enqueued | 3950 SimulateWheelEvent(-60, 0, 0, true); // enqueued |
| 3948 SimulateWheelEvent(-100, 0, 0, true); // coalesced into previous event | 3951 SimulateWheelEvent(-100, 0, 0, true); // coalesced into previous event |
| 3949 EXPECT_TRUE(ScrollStateIsUnknown()); | 3952 EXPECT_TRUE(ScrollStateIsUnknown()); |
| 3950 EXPECT_EQ(2U, GetSentMessageCountAndResetSink()); | 3953 EXPECT_EQ(3U, GetSentMessageCountAndResetSink()); |
| 3951 | 3954 |
| 3952 // The first wheel scroll did not scroll content. Overscroll should not start | 3955 // The first wheel scroll did not scroll content. Overscroll should not start |
| 3953 // yet, since enough hasn't been scrolled. | 3956 // yet, since enough hasn't been scrolled. |
| 3954 SendInputEventACK(WebInputEvent::MouseWheel, | 3957 SendInputEventACK(WebInputEvent::MouseWheel, |
| 3955 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 3958 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 3956 EXPECT_TRUE(ScrollStateIsUnknown()); | 3959 EXPECT_TRUE(ScrollStateIsUnknown()); |
| 3957 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); | 3960 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); |
| 3958 | 3961 |
| 3959 SendInputEventACK(WebInputEvent::MouseWheel, | 3962 SendInputEventACK(WebInputEvent::MouseWheel, |
| 3960 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 3963 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4469 view()->OnGestureEvent(&gesture_event); | 4472 view()->OnGestureEvent(&gesture_event); |
| 4470 | 4473 |
| 4471 EXPECT_TRUE(delegate->context_menu_request_received()); | 4474 EXPECT_TRUE(delegate->context_menu_request_received()); |
| 4472 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4475 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
| 4473 #endif | 4476 #endif |
| 4474 | 4477 |
| 4475 RenderViewHostFactory::set_is_real_render_view_host(false); | 4478 RenderViewHostFactory::set_is_real_render_view_host(false); |
| 4476 } | 4479 } |
| 4477 | 4480 |
| 4478 } // namespace content | 4481 } // namespace content |
| OLD | NEW |