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

Unified Diff: content/browser/session_history_browsertest.cc

Issue 2052633002: Extend the ToRenderFrameHost magic to FrameTreeNode* and Shell* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix induced script bug. Created 4 years, 6 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 1263c9683e893fb98667de1fcaf6ee264fbd7f16..acd569d6c8ab44079541faaf1b4ebb1ede4f9160 100644
--- a/content/browser/session_history_browsertest.cc
+++ b/content/browser/session_history_browsertest.cc
@@ -469,26 +469,20 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, LocationChangeInSubframe) {
IN_PROC_BROWSER_TEST_F(SessionHistoryTest, HistoryLength) {
int length;
ASSERT_TRUE(ExecuteScriptAndExtractInt(
- shell()->web_contents(),
- "domAutomationController.send(history.length)",
- &length));
+ shell(), "domAutomationController.send(history.length)", &length));
EXPECT_EQ(1, length);
NavigateToURL(shell(), GetURL("title1.html"));
ASSERT_TRUE(ExecuteScriptAndExtractInt(
- shell()->web_contents(),
- "domAutomationController.send(history.length)",
- &length));
+ shell(), "domAutomationController.send(history.length)", &length));
EXPECT_EQ(2, length);
// Now test that history.length is updated when the navigation is committed.
NavigateToURL(shell(), GetURL("record_length.html"));
ASSERT_TRUE(ExecuteScriptAndExtractInt(
- shell()->web_contents(),
- "domAutomationController.send(history.length)",
- &length));
+ shell(), "domAutomationController.send(history.length)", &length));
EXPECT_EQ(3, length);
GoBack();
@@ -498,9 +492,7 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, HistoryLength) {
NavigateToURL(shell(), GetURL("title2.html"));
ASSERT_TRUE(ExecuteScriptAndExtractInt(
- shell()->web_contents(),
- "domAutomationController.send(history.length)",
- &length));
+ shell(), "domAutomationController.send(history.length)", &length));
EXPECT_EQ(2, length);
}
@@ -525,8 +517,8 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, GoBackToCrossSitePostWithRedirect) {
// Submit the form.
TestNavigationObserver form_post_observer(shell()->web_contents(), 1);
- EXPECT_TRUE(ExecuteScript(shell()->web_contents(),
- "document.getElementById('form').submit();"));
+ EXPECT_TRUE(
+ ExecuteScript(shell(), "document.getElementById('form').submit();"));
form_post_observer.Wait();
// Verify that we arrived at the expected, redirected location.
@@ -537,7 +529,7 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, GoBackToCrossSitePostWithRedirect) {
// comes from: https://tools.ietf.org/html/rfc7231#section-6.4.7
std::string body;
EXPECT_TRUE(ExecuteScriptAndExtractString(
- shell()->web_contents(),
+ shell(),
"window.domAutomationController.send("
"document.getElementsByTagName('pre')[0].innerText);",
&body));
@@ -558,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(SessionHistoryTest, GoBackToCrossSitePostWithRedirect) {
// Again verify that POST body got preserved by 307 redirect.
std::string body_after_back_navigation;
EXPECT_TRUE(ExecuteScriptAndExtractString(
- shell()->web_contents(),
+ shell(),
"window.domAutomationController.send("
"document.getElementsByTagName('pre')[0].innerText);",
&body_after_back_navigation));

Powered by Google App Engine
This is Rietveld 408576698