| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/test/histogram_tester.h" | 11 #include "base/test/histogram_tester.h" |
| 12 #include "content/common/input/synthetic_web_input_event_builders.h" | 12 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 13 #include "content/common/input/web_input_event_traits.h" | |
| 14 #include "content/common/input_messages.h" | 13 #include "content/common/input_messages.h" |
| 15 #include "content/public/test/mock_render_thread.h" | 14 #include "content/public/test/mock_render_thread.h" |
| 16 #include "content/test/fake_compositor_dependencies.h" | 15 #include "content/test/fake_compositor_dependencies.h" |
| 17 #include "content/test/mock_render_process.h" | 16 #include "content/test/mock_render_process.h" |
| 18 #include "ipc/ipc_test_sink.h" | 17 #include "ipc/ipc_test_sink.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "third_party/WebKit/public/web/WebInputEvent.h" | 20 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 21 #include "ui/events/blink/web_input_event_traits.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 23 | 23 |
| 24 using testing::_; | 24 using testing::_; |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 const char* EVENT_LISTENER_RESULT_HISTOGRAM = "Event.PassiveListeners"; | 30 const char* EVENT_LISTENER_RESULT_HISTOGRAM = "Event.PassiveListeners"; |
| 31 | 31 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 SetRoutingID(++next_routing_id_); | 62 SetRoutingID(++next_routing_id_); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { | 65 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { |
| 66 rects_ = rects; | 66 rects_ = rects; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void SendInputEvent(const blink::WebInputEvent& event) { | 69 void SendInputEvent(const blink::WebInputEvent& event) { |
| 70 OnHandleInputEvent( | 70 OnHandleInputEvent( |
| 71 &event, ui::LatencyInfo(), | 71 &event, ui::LatencyInfo(), |
| 72 WebInputEventTraits::ShouldBlockEventStream(event) | 72 ui::WebInputEventTraits::ShouldBlockEventStream(event) |
| 73 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING | 73 ? InputEventDispatchType::DISPATCH_TYPE_BLOCKING |
| 74 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); | 74 : InputEventDispatchType::DISPATCH_TYPE_NON_BLOCKING); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void set_always_overscroll(bool overscroll) { | 77 void set_always_overscroll(bool overscroll) { |
| 78 always_overscroll_ = overscroll; | 78 always_overscroll_ = overscroll; |
| 79 } | 79 } |
| 80 | 80 |
| 81 IPC::TestSink* sink() { return &sink_; } | 81 IPC::TestSink* sink() { return &sink_; } |
| 82 | 82 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 histogram_tester().ExpectTotalCount( | 342 histogram_tester().ExpectTotalCount( |
| 343 "Event.Touch.TouchStartLatencyDuringFling", 1); | 343 "Event.Touch.TouchStartLatencyDuringFling", 1); |
| 344 | 344 |
| 345 touch.dispatchedDuringFling = false; | 345 touch.dispatchedDuringFling = false; |
| 346 widget()->SendInputEvent(touch); | 346 widget()->SendInputEvent(touch); |
| 347 histogram_tester().ExpectTotalCount( | 347 histogram_tester().ExpectTotalCount( |
| 348 "Event.Touch.TouchStartLatencyOutsideFling", 1); | 348 "Event.Touch.TouchStartLatencyOutsideFling", 1); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |