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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 if (command) { | 666 if (command) { |
667 modifiers &= ~blink::WebInputEvent::MetaKey; | 667 modifiers &= ~blink::WebInputEvent::MetaKey; |
668 InjectRawKeyEvent(web_contents, blink::WebInputEvent::KeyUp, | 668 InjectRawKeyEvent(web_contents, blink::WebInputEvent::KeyUp, |
669 ui::DomKey::META, ui::DomCode::META_LEFT, | 669 ui::DomKey::META, ui::DomCode::META_LEFT, |
670 ui::VKEY_COMMAND, modifiers); | 670 ui::VKEY_COMMAND, modifiers); |
671 } | 671 } |
672 | 672 |
673 ASSERT_EQ(modifiers, 0); | 673 ASSERT_EQ(modifiers, 0); |
674 } | 674 } |
675 | 675 |
676 ToRenderFrameHost::ToRenderFrameHost(WebContents* web_contents) | 676 RenderFrameHost* ConvertToRenderFrameHost(WebContents* web_contents) { |
677 : render_frame_host_(web_contents->GetMainFrame()) { | 677 return web_contents->GetMainFrame(); |
678 } | 678 } |
679 | 679 |
680 ToRenderFrameHost::ToRenderFrameHost(RenderViewHost* render_view_host) | 680 RenderFrameHost* ConvertToRenderFrameHost(RenderViewHost* render_view_host) { |
681 : render_frame_host_(render_view_host->GetMainFrame()) { | 681 return render_view_host->GetMainFrame(); |
682 } | 682 } |
683 | 683 |
684 ToRenderFrameHost::ToRenderFrameHost(RenderFrameHost* render_frame_host) | 684 RenderFrameHost* ConvertToRenderFrameHost(RenderFrameHost* render_frame_host) { |
685 : render_frame_host_(render_frame_host) { | 685 return render_frame_host; |
686 } | 686 } |
687 | 687 |
688 bool ExecuteScript(const ToRenderFrameHost& adapter, | 688 bool ExecuteScript(const ToRenderFrameHost& adapter, |
689 const std::string& script) { | 689 const std::string& script) { |
690 std::string new_script = | 690 std::string new_script = |
691 script + ";window.domAutomationController.send(0);"; | 691 script + ";window.domAutomationController.send(0);"; |
692 return ExecuteScriptHelper(adapter.render_frame_host(), new_script, NULL); | 692 return ExecuteScriptHelper(adapter.render_frame_host(), new_script, NULL); |
693 } | 693 } |
694 | 694 |
695 bool ExecuteScriptAndExtractDouble(const ToRenderFrameHost& adapter, | 695 bool ExecuteScriptAndExtractDouble(const ToRenderFrameHost& adapter, |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1274 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1275 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) | 1275 if (ack_result_ != INPUT_EVENT_ACK_STATE_UNKNOWN) |
1276 return ack_result_; | 1276 return ack_result_; |
1277 base::RunLoop run_loop; | 1277 base::RunLoop run_loop; |
1278 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); | 1278 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); |
1279 run_loop.Run(); | 1279 run_loop.Run(); |
1280 return ack_result_; | 1280 return ack_result_; |
1281 } | 1281 } |
1282 | 1282 |
1283 } // namespace content | 1283 } // namespace content |
OLD | NEW |