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/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 void BuildSimpleWebKeyEvent(blink::WebInputEvent::Type type, | 219 void BuildSimpleWebKeyEvent(blink::WebInputEvent::Type type, |
220 ui::DomKey key, | 220 ui::DomKey key, |
221 ui::DomCode code, | 221 ui::DomCode code, |
222 ui::KeyboardCode key_code, | 222 ui::KeyboardCode key_code, |
223 int modifiers, | 223 int modifiers, |
224 NativeWebKeyboardEvent* event) { | 224 NativeWebKeyboardEvent* event) { |
225 event->domKey = key; | 225 event->domKey = key; |
226 event->domCode = static_cast<int>(code); | 226 event->domCode = static_cast<int>(code); |
227 event->nativeKeyCode = ui::KeycodeConverter::DomCodeToNativeKeycode(code); | 227 event->nativeKeyCode = ui::KeycodeConverter::DomCodeToNativeKeycode(code); |
228 event->windowsKeyCode = key_code; | 228 event->windowsKeyCode = key_code; |
229 event->setKeyIdentifierFromWindowsKeyCode(); | |
230 event->type = type; | 229 event->type = type; |
231 event->modifiers = modifiers; | 230 event->modifiers = modifiers; |
232 event->isSystemKey = false; | 231 event->isSystemKey = false; |
233 event->timeStampSeconds = | 232 event->timeStampSeconds = |
234 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | 233 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
235 event->skip_in_browser = true; | 234 event->skip_in_browser = true; |
236 | 235 |
237 if (type == blink::WebInputEvent::Char || | 236 if (type == blink::WebInputEvent::Char || |
238 type == blink::WebInputEvent::RawKeyDown) { | 237 type == blink::WebInputEvent::RawKeyDown) { |
239 event->text[0] = key_code; | 238 event->text[0] = key_code; |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1316 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1318 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1317 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1319 return ack_result_; | 1318 return ack_result_; |
1320 base::RunLoop run_loop; | 1319 base::RunLoop run_loop; |
1321 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1320 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1322 run_loop.Run(); | 1321 run_loop.Run(); |
1323 return ack_result_; | 1322 return ack_result_; |
1324 } | 1323 } |
1325 | 1324 |
1326 } // namespace content | 1325 } // namespace content |
OLD | NEW |