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

Unified Diff: chrome/browser/ui/pdf/pdf_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/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/webui/bookmarks_ui_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/pdf/pdf_browsertest.cc
diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc
index 41900de42bfb556100e6280e3f4e8267898eb084..480d01538c89e44efcf3e5853b6341074e2d8d20 100644
--- a/chrome/browser/ui/pdf/pdf_browsertest.cc
+++ b/chrome/browser/ui/pdf/pdf_browsertest.cc
@@ -249,9 +249,8 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) {
ASSERT_NO_FATAL_FAILURE(WaitForResponse());
int y_offset = 0;
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractInt(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
+ chrome::GetActiveWebContents(browser()),
"window.domAutomationController.send(plugin.pageYOffset())",
&y_offset));
ASSERT_GT(y_offset, 0);
@@ -338,9 +337,8 @@ IN_PROC_BROWSER_TEST_P(PDFBrowserTest, Loading) {
// doing async loading. This happens when the first loader is cancelled
// and before creating a byte-range request loader.
bool complete = false;
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
+ chrome::GetActiveWebContents(browser()),
"window.domAutomationController.send(plugin.documentLoadComplete())",
&complete));
if (complete)
@@ -362,27 +360,23 @@ INSTANTIATE_TEST_CASE_P(PDFTestFiles,
IN_PROC_BROWSER_TEST_F(PDFBrowserTest, Action) {
ASSERT_NO_FATAL_FAILURE(Load());
- ASSERT_TRUE(content::ExecuteJavaScript(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScript(
+ chrome::GetActiveWebContents(browser()),
"document.getElementsByName('plugin')[0].fitToHeight();"));
std::string zoom1, zoom2;
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScriptAndExtractString(
+ chrome::GetActiveWebContents(browser()),
"window.domAutomationController.send("
" document.getElementsByName('plugin')[0].getZoomLevel().toString())",
&zoom1));
- ASSERT_TRUE(content::ExecuteJavaScript(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScript(
+ chrome::GetActiveWebContents(browser()),
"document.getElementsByName('plugin')[0].fitToWidth();"));
- ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScriptAndExtractString(
+ chrome::GetActiveWebContents(browser()),
"window.domAutomationController.send("
" document.getElementsByName('plugin')[0].getZoomLevel().toString())",
&zoom2));
@@ -400,9 +394,8 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, DISABLED_OnLoadAndReload) {
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(
&chrome::GetActiveWebContents(browser())->GetController()));
- ASSERT_TRUE(content::ExecuteJavaScript(
- chrome::GetActiveWebContents(browser())->GetRenderViewHost(),
- std::string(),
+ ASSERT_TRUE(content::ExecuteScript(
+ chrome::GetActiveWebContents(browser()),
"reloadPDF();"));
observer.Wait();
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | chrome/browser/ui/webui/bookmarks_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698