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 "chrome/browser/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1009 |
1010 void TestingAutomationProvider::ExecuteJavascriptInRenderViewFrame( | 1010 void TestingAutomationProvider::ExecuteJavascriptInRenderViewFrame( |
1011 const base::string16& frame_xpath, | 1011 const base::string16& frame_xpath, |
1012 const base::string16& script, | 1012 const base::string16& script, |
1013 IPC::Message* reply_message, | 1013 IPC::Message* reply_message, |
1014 RenderViewHost* render_view_host) { | 1014 RenderViewHost* render_view_host) { |
1015 // Set the routing id of this message with the controller. | 1015 // Set the routing id of this message with the controller. |
1016 // This routing id needs to be remembered for the reverse | 1016 // This routing id needs to be remembered for the reverse |
1017 // communication while sending back the response of | 1017 // communication while sending back the response of |
1018 // this javascript execution. | 1018 // this javascript execution. |
1019 render_view_host->ExecuteJavascriptInWebFrame( | 1019 |
1020 frame_xpath, | 1020 // Automation is dead. http://crbug.com/316203 |
1021 base::ASCIIToUTF16("window.domAutomationController.setAutomationId(0);")); | 1021 NOTREACHED() << "Automation is dead."; |
1022 render_view_host->ExecuteJavascriptInWebFrame( | |
1023 frame_xpath, script); | |
1024 } | 1022 } |
1025 | 1023 |
1026 void TestingAutomationProvider::ExecuteJavascript( | 1024 void TestingAutomationProvider::ExecuteJavascript( |
1027 int handle, | 1025 int handle, |
1028 const std::wstring& frame_xpath, | 1026 const std::wstring& frame_xpath, |
1029 const std::wstring& script, | 1027 const std::wstring& script, |
1030 IPC::Message* reply_message) { | 1028 IPC::Message* reply_message) { |
1031 WebContents* web_contents = GetWebContentsForHandle(handle, NULL); | 1029 WebContents* web_contents = GetWebContentsForHandle(handle, NULL); |
1032 if (!web_contents) { | 1030 if (!web_contents) { |
1033 AutomationMsg_DomOperation::WriteReplyParams(reply_message, std::string()); | 1031 AutomationMsg_DomOperation::WriteReplyParams(reply_message, std::string()); |
(...skipping 4206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5240 if (g_browser_process) | 5238 if (g_browser_process) |
5241 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5239 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
5242 } | 5240 } |
5243 | 5241 |
5244 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5242 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
5245 WebContents* tab) { | 5243 WebContents* tab) { |
5246 TabStripModel* tab_strip = browser->tab_strip_model(); | 5244 TabStripModel* tab_strip = browser->tab_strip_model(); |
5247 if (tab_strip->GetActiveWebContents() != tab) | 5245 if (tab_strip->GetActiveWebContents() != tab) |
5248 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5246 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
5249 } | 5247 } |
OLD | NEW |