Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 9950098: Fixed bug where the ExecuteJavascript() family of PyAuto hooks ignored the automation id of message… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Found a use where this change broke ExecuteJavascript, this should fix it. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 1315
1316 void ExecuteJavascriptInRenderViewFrame( 1316 void ExecuteJavascriptInRenderViewFrame(
1317 const string16& frame_xpath, 1317 const string16& frame_xpath,
1318 const string16& script, 1318 const string16& script,
1319 IPC::Message* reply_message, 1319 IPC::Message* reply_message,
1320 RenderViewHost* render_view_host) { 1320 RenderViewHost* render_view_host) {
1321 // Set the routing id of this message with the controller. 1321 // Set the routing id of this message with the controller.
1322 // This routing id needs to be remembered for the reverse 1322 // This routing id needs to be remembered for the reverse
1323 // communication while sending back the response of 1323 // communication while sending back the response of
1324 // this javascript execution. 1324 // this javascript execution.
1325 std::string set_automation_id;
1326 base::SStringPrintf(&set_automation_id,
1327 "window.domAutomationController.setAutomationId(%d);",
1328 reply_message->routing_id());
1329
1330 render_view_host->ExecuteJavascriptInWebFrame( 1325 render_view_host->ExecuteJavascriptInWebFrame(
1331 frame_xpath, UTF8ToUTF16(set_automation_id)); 1326 frame_xpath,
1327 UTF8ToUTF16("window.domAutomationController.setAutomationId(0);"));
1332 render_view_host->ExecuteJavascriptInWebFrame( 1328 render_view_host->ExecuteJavascriptInWebFrame(
1333 frame_xpath, script); 1329 frame_xpath, script);
1334 } 1330 }
1335 1331
1336 } // namespace 1332 } // namespace
1337 1333
1338 void TestingAutomationProvider::ExecuteJavascript( 1334 void TestingAutomationProvider::ExecuteJavascript(
1339 int handle, 1335 int handle,
1340 const std::wstring& frame_xpath, 1336 const std::wstring& frame_xpath,
1341 const std::wstring& script, 1337 const std::wstring& script,
(...skipping 5640 matching lines...) Expand 10 before | Expand all | Expand 10 after
6982 *browser_handle = browser_tracker_->Add(browser); 6978 *browser_handle = browser_tracker_->Add(browser);
6983 *success = true; 6979 *success = true;
6984 } 6980 }
6985 } 6981 }
6986 } 6982 }
6987 6983
6988 void TestingAutomationProvider::OnRemoveProvider() { 6984 void TestingAutomationProvider::OnRemoveProvider() {
6989 if (g_browser_process) 6985 if (g_browser_process)
6990 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6986 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6991 } 6987 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698