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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 InjectRawKeyEvent( | 588 InjectRawKeyEvent( |
589 web_contents, blink::WebInputEvent::RawKeyDown, ui::VKEY_MENU, | 589 web_contents, blink::WebInputEvent::RawKeyDown, ui::VKEY_MENU, |
590 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::ALT_LEFT), | 590 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::ALT_LEFT), |
591 modifiers); | 591 modifiers); |
592 } | 592 } |
593 | 593 |
594 if (command) { | 594 if (command) { |
595 modifiers |= blink::WebInputEvent::MetaKey; | 595 modifiers |= blink::WebInputEvent::MetaKey; |
596 InjectRawKeyEvent( | 596 InjectRawKeyEvent( |
597 web_contents, blink::WebInputEvent::RawKeyDown, ui::VKEY_COMMAND, | 597 web_contents, blink::WebInputEvent::RawKeyDown, ui::VKEY_COMMAND, |
598 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::OS_LEFT), | 598 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::META_LEFT), |
599 modifiers); | 599 modifiers); |
600 } | 600 } |
601 InjectRawKeyEvent(web_contents, blink::WebInputEvent::RawKeyDown, key_code, | 601 InjectRawKeyEvent(web_contents, blink::WebInputEvent::RawKeyDown, key_code, |
602 native_key_code, modifiers); | 602 native_key_code, modifiers); |
603 | 603 |
604 InjectRawKeyEvent(web_contents, blink::WebInputEvent::Char, key_code, | 604 InjectRawKeyEvent(web_contents, blink::WebInputEvent::Char, key_code, |
605 native_key_code, modifiers); | 605 native_key_code, modifiers); |
606 | 606 |
607 InjectRawKeyEvent(web_contents, blink::WebInputEvent::KeyUp, key_code, | 607 InjectRawKeyEvent(web_contents, blink::WebInputEvent::KeyUp, key_code, |
608 native_key_code, modifiers); | 608 native_key_code, modifiers); |
(...skipping 20 matching lines...) Expand all Loading... |
629 InjectRawKeyEvent( | 629 InjectRawKeyEvent( |
630 web_contents, blink::WebInputEvent::KeyUp, ui::VKEY_MENU, | 630 web_contents, blink::WebInputEvent::KeyUp, ui::VKEY_MENU, |
631 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::ALT_LEFT), | 631 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::ALT_LEFT), |
632 modifiers); | 632 modifiers); |
633 } | 633 } |
634 | 634 |
635 if (command) { | 635 if (command) { |
636 modifiers &= ~blink::WebInputEvent::MetaKey; | 636 modifiers &= ~blink::WebInputEvent::MetaKey; |
637 InjectRawKeyEvent( | 637 InjectRawKeyEvent( |
638 web_contents, blink::WebInputEvent::KeyUp, ui::VKEY_COMMAND, | 638 web_contents, blink::WebInputEvent::KeyUp, ui::VKEY_COMMAND, |
639 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::OS_LEFT), | 639 ui::KeycodeConverter::DomCodeToNativeKeycode(ui::DomCode::META_LEFT), |
640 modifiers); | 640 modifiers); |
641 } | 641 } |
642 | 642 |
643 ASSERT_EQ(modifiers, 0); | 643 ASSERT_EQ(modifiers, 0); |
644 } | 644 } |
645 | 645 |
646 ToRenderFrameHost::ToRenderFrameHost(WebContents* web_contents) | 646 ToRenderFrameHost::ToRenderFrameHost(WebContents* web_contents) |
647 : render_frame_host_(web_contents->GetMainFrame()) { | 647 : render_frame_host_(web_contents->GetMainFrame()) { |
648 } | 648 } |
649 | 649 |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1229 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1230 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1230 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1231 return ack_result_; | 1231 return ack_result_; |
1232 base::RunLoop run_loop; | 1232 base::RunLoop run_loop; |
1233 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1233 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1234 run_loop.Run(); | 1234 run_loop.Run(); |
1235 return ack_result_; | 1235 return ack_result_; |
1236 } | 1236 } |
1237 | 1237 |
1238 } // namespace content | 1238 } // namespace content |
OLD | NEW |