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

Unified Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 11753009: Simplify ExecuteJavaScript* functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update prerender_browsertest.cc. Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/history/history_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/geolocation_browsertest.cc
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 12694718d7cc723982fb0c86bd7cc61af58b4534..3bfe5716e0e524f8d0f61a76a8b80c344a50110d 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -69,9 +69,8 @@ class IFrameLoader : public content::NotificationObserver {
script = base::StringPrintf(
"window.domAutomationController.send(getIFrameSrc(%d))", iframe_id);
std::string iframe_src;
- EXPECT_TRUE(content::ExecuteJavaScriptAndExtractString(
- chrome::GetActiveWebContents(browser)->GetRenderViewHost(),
- "",
+ EXPECT_TRUE(content::ExecuteScriptAndExtractString(
+ chrome::GetActiveWebContents(browser),
script,
&iframe_src));
iframe_url_ = GURL(iframe_src);
@@ -329,8 +328,8 @@ class GeolocationBrowserTest : public InProcessBrowserTest {
std::string script = base::StringPrintf(
"window.domAutomationController.send(%s)", function.c_str());
std::string result;
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
- web_contents->GetRenderViewHost(),
+ ASSERT_TRUE(content::ExecuteScriptInFrameAndExtractString(
+ web_contents,
iframe_xpath_,
script,
&result));
@@ -612,9 +611,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TwoWatchesInOneFrame) {
"window.domAutomationController.send(geoSetFinalPosition(%f, %f))",
final_position_latitude, final_position_longitude);
std::string js_result;
- EXPECT_TRUE(content::ExecuteJavaScriptAndExtractString(
- chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(),
- "",
+ EXPECT_TRUE(content::ExecuteScriptAndExtractString(
+ chrome::GetActiveWebContents(current_browser_),
script,
&js_result));
EXPECT_EQ(js_result, "ok");
@@ -652,9 +650,8 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TabDestroyed) {
std::string script =
"window.domAutomationController.send(window.close());";
bool result =
- content::ExecuteJavaScript(
- chrome::GetActiveWebContents(current_browser_)->GetRenderViewHost(),
- "",
+ content::ExecuteScript(
+ chrome::GetActiveWebContents(current_browser_),
script);
EXPECT_EQ(result, true);
}
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/history/history_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698