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

Unified Diff: chrome/browser/notifications/notification_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/net/load_timing_observer_browsertest.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/notification_browsertest.cc
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc
index f4c64715cb7cb0b188f7c032001348d59792aed5..e1f800adfb39c1333b279001ab2bd55056775570 100644
--- a/chrome/browser/notifications/notification_browsertest.cc
+++ b/chrome/browser/notifications/notification_browsertest.cc
@@ -272,9 +272,8 @@ std::string NotificationsTest::CreateNotification(
NotificationBalloonChangeObserver observer;
std::string result;
- bool success = content::ExecuteJavaScriptAndExtractString(
- browser->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(),
- "",
+ bool success = content::ExecuteScriptAndExtractString(
+ browser->tab_strip_model()->GetActiveWebContents(),
script,
&result);
if (success && result != "-1" && wait_for_new_balloon)
@@ -299,9 +298,8 @@ bool NotificationsTest::RequestPermissionAndWait(Browser* browser) {
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
content::Source<InfoBarService>(infobar_service));
std::string result;
- bool success = content::ExecuteJavaScriptAndExtractString(
- browser->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(),
- "",
+ bool success = content::ExecuteScriptAndExtractString(
+ browser->tab_strip_model()->GetActiveWebContents(),
"requestPermission();",
&result);
if (!success || result != "1")
@@ -319,9 +317,8 @@ bool NotificationsTest::CancelNotification(
NotificationBalloonChangeObserver observer;
std::string result;
- bool success = content::ExecuteJavaScriptAndExtractString(
- browser->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(),
- "",
+ bool success = content::ExecuteScriptAndExtractString(
+ browser->tab_strip_model()->GetActiveWebContents(),
script,
&result);
if (!success || result != "1")
@@ -412,9 +409,8 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestUserGestureInfobar) {
// Request permission by calling request() while eval'ing an inline script;
// That's considered a user gesture to webkit, and should produce an infobar.
bool result;
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
- browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(),
- "",
+ ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
+ browser()->tab_strip_model()->GetActiveWebContents(),
"window.domAutomationController.send(request());",
&result));
EXPECT_TRUE(result);
« no previous file with comments | « chrome/browser/net/load_timing_observer_browsertest.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698