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

Unified Diff: content/browser/session_history_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
Index: content/browser/session_history_browsertest.cc
diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc
index c81f89c0830b936b24722cda3b2f348a5dd52589..c57f1a69ca75de7da1a5d71100c059e75508310f 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);

Powered by Google App Engine
This is Rietveld 408576698