summaryrefslogtreecommitdiffstats
path: root/content/browser/session_history_browsertest.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-04 18:30:43 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-04 18:30:43 +0000
commitb6987e0e556a5f72e5e783aae0e30e883cf66f91 (patch)
treefb07c2c5803510285ef0d030d42eb6ced5a8d2b7 /content/browser/session_history_browsertest.cc
parent53bc1a4364a3a75344e20f94aedff2eca2f6f9af (diff)
downloadchromium_src-b6987e0e556a5f72e5e783aae0e30e883cf66f91.zip
chromium_src-b6987e0e556a5f72e5e783aae0e30e883cf66f91.tar.gz
chromium_src-b6987e0e556a5f72e5e783aae0e30e883cf66f91.tar.bz2
Simplify ExecuteJavaScript* functions.
Remove the "Java" and rename to ExecuteScript*. This better matches conventions elsewhere in the codebase. Introduce ExecuteScriptInFrame* variants for the less common case where script execution in a subframe is desired. Make it possible to pass the ExecuteScript* family of functions either a WebContents pointer or a RenderViewHost pointer to further simplify callsites. R=jam@chromium.org BUG=none Review URL: https://chromiumcodereview.appspot.com/11753009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/session_history_browsertest.cc')
-rw-r--r--content/browser/session_history_browsertest.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc
index c81f89c..c57f1a6 100644
--- a/content/browser/session_history_browsertest.cc
+++ b/content/browser/session_history_browsertest.cc
@@ -429,18 +429,16 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, LocationChangeInSubframe) {
// http://code.google.com/p/chromium/issues/detail?id=56267
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, HistoryLength) {
int length;
- ASSERT_TRUE(ExecuteJavaScriptAndExtractInt(
- shell()->web_contents()->GetRenderViewHost(),
- "",
+ ASSERT_TRUE(ExecuteScriptAndExtractInt(
+ shell()->web_contents(),
"domAutomationController.send(history.length)",
&length));
EXPECT_EQ(1, length);
NavigateToURL(shell(), GetURL("title1.html"));
- ASSERT_TRUE(ExecuteJavaScriptAndExtractInt(
- shell()->web_contents()->GetRenderViewHost(),
- "",
+ ASSERT_TRUE(ExecuteScriptAndExtractInt(
+ shell()->web_contents(),
"domAutomationController.send(history.length)",
&length));
EXPECT_EQ(2, length);
@@ -448,9 +446,8 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, HistoryLength) {
// Now test that history.length is updated when the navigation is committed.
NavigateToURL(shell(), GetURL("record_length.html"));
- ASSERT_TRUE(ExecuteJavaScriptAndExtractInt(
- shell()->web_contents()->GetRenderViewHost(),
- "",
+ ASSERT_TRUE(ExecuteScriptAndExtractInt(
+ shell()->web_contents(),
"domAutomationController.send(history.length)",
&length));
EXPECT_EQ(3, length);
@@ -461,9 +458,8 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, HistoryLength) {
// Ensure history.length is properly truncated.
NavigateToURL(shell(), GetURL("title2.html"));
- ASSERT_TRUE(ExecuteJavaScriptAndExtractInt(
- shell()->web_contents()->GetRenderViewHost(),
- "",
+ ASSERT_TRUE(ExecuteScriptAndExtractInt(
+ shell()->web_contents(),
"domAutomationController.send(history.length)",
&length));
EXPECT_EQ(2, length);