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

Unified Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 1123783002: Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/prerender/prerender_browsertest.cc
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index c24cfee6929a15c1cf7ef787b8757a30f947028f..906357c6004251e135f586af924afcb97f2a14c5 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -1263,14 +1263,15 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
}
void RemoveLinkElement(int i) const {
- GetActiveWebContents()->GetMainFrame()->ExecuteJavaScript(
+ GetActiveWebContents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::ASCIIToUTF16(base::StringPrintf("RemoveLinkElement(%d)", i)));
}
void ClickToNextPageAfterPrerender() {
TestNavigationObserver nav_observer(GetActiveWebContents());
RenderFrameHost* render_frame_host = GetActiveWebContents()->GetMainFrame();
- render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16("ClickOpenLink()"));
+ render_frame_host->ExecuteJavaScriptForTests(
+ base::ASCIIToUTF16("ClickOpenLink()"));
nav_observer.Wait();
}
@@ -1528,7 +1529,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
std::string javascript = base::StringPrintf(
"AddPrerender('%s', %d)", url.spec().c_str(), index);
RenderFrameHost* render_frame_host = GetActiveWebContents()->GetMainFrame();
- render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16(javascript));
+ render_frame_host->ExecuteJavaScriptForTests(
+ base::ASCIIToUTF16(javascript));
}
// Returns a string for pattern-matching TaskManager tab entries.
@@ -1678,7 +1680,8 @@ class PrerenderBrowserTest : virtual public InProcessBrowserTest {
} else {
NavigationOrSwapObserver observer(current_browser()->tab_strip_model(),
web_contents);
- render_frame_host->ExecuteJavaScript(base::ASCIIToUTF16(javascript));
+ render_frame_host->ExecuteJavaScriptForTests(
+ base::ASCIIToUTF16(javascript));
observer.Wait();
}
}
« no previous file with comments | « chrome/browser/mouseleave_browsertest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698