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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/common/input/synthetic_web_input_event_builders.h" | 10 #include "content/common/input/synthetic_web_input_event_builders.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 " third.ontouchstart = function(e) {" | 72 " third.ontouchstart = function(e) {" |
73 " e.preventDefault();" | 73 " e.preventDefault();" |
74 " };" | 74 " };" |
75 " }" | 75 " }" |
76 "</script>"; | 76 "</script>"; |
77 | 77 |
78 } // namespace | 78 } // namespace |
79 | 79 |
80 namespace content { | 80 namespace content { |
81 | 81 |
| 82 const uint32 kFilteredMessageClasses[] = { |
| 83 InputMsgStart, |
| 84 }; |
| 85 |
82 class InputEventMessageFilter : public BrowserMessageFilter { | 86 class InputEventMessageFilter : public BrowserMessageFilter { |
83 public: | 87 public: |
84 InputEventMessageFilter() | 88 InputEventMessageFilter() |
85 : type_(WebInputEvent::Undefined), | 89 : BrowserMessageFilter( |
| 90 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), |
| 91 type_(WebInputEvent::Undefined), |
86 state_(INPUT_EVENT_ACK_STATE_UNKNOWN) {} | 92 state_(INPUT_EVENT_ACK_STATE_UNKNOWN) {} |
87 | 93 |
88 void WaitForAck(WebInputEvent::Type type) { | 94 void WaitForAck(WebInputEvent::Type type) { |
89 base::RunLoop run_loop; | 95 base::RunLoop run_loop; |
90 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 96 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
91 base::AutoReset<WebInputEvent::Type> reset_type(&type_, type); | 97 base::AutoReset<WebInputEvent::Type> reset_type(&type_, type); |
92 run_loop.Run(); | 98 run_loop.Run(); |
93 } | 99 } |
94 | 100 |
95 InputEventAckState last_ack_state() const { return state_; } | 101 InputEventAckState last_ack_state() const { return state_; } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 291 |
286 INSTANTIATE_TEST_CASE_P(WithoutInputHandlerProxy, TouchInputBrowserTest, | 292 INSTANTIATE_TEST_CASE_P(WithoutInputHandlerProxy, TouchInputBrowserTest, |
287 ::testing::Values(std::string(switches::kDisableThreadedCompositing))); | 293 ::testing::Values(std::string(switches::kDisableThreadedCompositing))); |
288 | 294 |
289 #if !defined(OS_MACOSX) | 295 #if !defined(OS_MACOSX) |
290 INSTANTIATE_TEST_CASE_P(WithInputHandlerProxy, TouchInputBrowserTest, | 296 INSTANTIATE_TEST_CASE_P(WithInputHandlerProxy, TouchInputBrowserTest, |
291 ::testing::Values(std::string(switches::kEnableThreadedCompositing))); | 297 ::testing::Values(std::string(switches::kEnableThreadedCompositing))); |
292 #endif | 298 #endif |
293 | 299 |
294 } // namespace content | 300 } // namespace content |
OLD | NEW |