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

Unified Diff: chrome/browser/ui/browser_browsertest.cc

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: chrome/browser/ui/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 43ca35392af70c3aa35e25a9a6f3b1be1c7afd72..e1390ac329148cbc079329c20a036d81901202f0 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -544,7 +544,7 @@
EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
WebContents* second_tab = browser()->tab_strip_model()->GetWebContentsAt(1);
ASSERT_TRUE(second_tab);
- second_tab->GetMainFrame()->ExecuteJavaScriptForTests(
+ second_tab->GetMainFrame()->ExecuteJavaScript(
ASCIIToUTF16("alert('Activate!');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
alert->CloseModalDialog();
@@ -651,7 +651,7 @@
// even if the renderer tries to synchronously create more.
// See http://crbug.com/312490.
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
- contents->GetMainFrame()->ExecuteJavaScriptForTests(
+ contents->GetMainFrame()->ExecuteJavaScript(
ASCIIToUTF16("alert('one'); alert('two');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
EXPECT_TRUE(alert->IsValid());
@@ -677,7 +677,7 @@
// Start a navigation to trigger the beforeunload dialog.
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
- contents->GetMainFrame()->ExecuteJavaScriptForTests(
+ contents->GetMainFrame()->ExecuteJavaScript(
ASCIIToUTF16("window.location.href = 'data:text/html,foo'"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
EXPECT_TRUE(alert->IsValid());
@@ -703,7 +703,7 @@
IN_PROC_BROWSER_TEST_F(BrowserTest, SadTabCancelsSubframeDialogs) {
// Navigate to an iframe that opens an alert dialog.
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
- contents->GetMainFrame()->ExecuteJavaScriptForTests(
+ contents->GetMainFrame()->ExecuteJavaScript(
ASCIIToUTF16("window.location.href = 'data:text/html,"
"<iframe srcdoc=\"<script>alert(1)</script>\">'"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
@@ -767,7 +767,7 @@
// Clear the beforeunload handler so the test can easily exit.
browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()->
- ExecuteJavaScriptForTests(ASCIIToUTF16("onbeforeunload=null;"));
+ ExecuteJavaScript(ASCIIToUTF16("onbeforeunload=null;"));
}
class RedirectObserver : public content::WebContentsObserver {
@@ -928,7 +928,7 @@
// Clear the beforeunload handler so the test can easily exit.
browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()->
- ExecuteJavaScriptForTests(ASCIIToUTF16("onbeforeunload=null;"));
+ ExecuteJavaScript(ASCIIToUTF16("onbeforeunload=null;"));
}
// Test for crbug.com/11647. A page closed with window.close() should not have
@@ -2068,7 +2068,7 @@
ui_test_utils::NavigateToURL(browser(), url);
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
- contents->GetMainFrame()->ExecuteJavaScriptForTests(
+ contents->GetMainFrame()->ExecuteJavaScript(
ASCIIToUTF16("alert('Dialog showing!');"));
AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
EXPECT_TRUE(alert->IsValid());

Powered by Google App Engine
This is Rietveld 408576698