summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/navigation_test.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 22:22:01 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 22:22:01 +0000
commit070c49c0f0578ccda58ccc4d3528f9458b5a2879 (patch)
tree58ff235ee5d107b988c29ce649945c2cc779a2f8 /chrome_frame/test/navigation_test.cc
parentbdf411b661a997857619a520c2812e98ba8006a1 (diff)
downloadchromium_src-070c49c0f0578ccda58ccc4d3528f9458b5a2879.zip
chromium_src-070c49c0f0578ccda58ccc4d3528f9458b5a2879.tar.gz
chromium_src-070c49c0f0578ccda58ccc4d3528f9458b5a2879.tar.bz2
ChromeFrame back forward navigations at times would mess up the navigation history if the back and the current page both
were rendered in ChromeFrame. This was because the back operation would incorrectly navigate twice. Once via IE history navigation and the other navigation would originate within the renderer and would execute as a new navigation in IE. Fix is to not report backforward navigations as top level navigations to the external host. Fixes bug http://code.google.com/p/chromium/issues/detail?id=44403 Bug=44403 Test=Covered by ChromeFrame test Review URL: http://codereview.chromium.org/2982003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/navigation_test.cc')
-rw-r--r--chrome_frame/test/navigation_test.cc47
1 files changed, 46 insertions, 1 deletions
diff --git a/chrome_frame/test/navigation_test.cc b/chrome_frame/test/navigation_test.cc
index 6258350..50da567 100644
--- a/chrome_frame/test/navigation_test.cc
+++ b/chrome_frame/test/navigation_test.cc
@@ -632,4 +632,49 @@ TEST_F(NavigationTest, DISABLED_DownloadInNewWindow) {
LaunchIEAndNavigate(kDownloadFromNewWin);
}
-} // namespace chrome_frame_test \ No newline at end of file
+TEST_P(FullTabNavigationTest, FLAKY_FormPostBackForward) {
+ bool in_cf = GetParam().invokes_cf();
+ // Navigate to the form-get.html page:
+ // - First set focus to chrome renderer window
+ // - Send over a character to the window.
+ // - This should initiate a form post which eventually navigates to the
+ // action.html page.
+ // Navigate backwards from the action.html page and then navigate forward
+ // from the form-get.html page.
+
+ std::wstring kFormPostUrl =
+ GetTestUrl(L"form-get.html");
+
+ std::wstring kFormPostActionUrl =
+ GetTestUrl(L"action.html?field1=a&field2=b&submit=Submit");
+
+ server_mock_.ExpectAndServeAnyRequests(GetParam());
+ InSequence expect_in_sequence_for_scope;
+
+ ie_mock_.ExpectNavigation(in_cf, kFormPostUrl);
+ EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostUrl)))
+ .WillOnce(testing::DoAll(
+ SetFocusToRenderer(&ie_mock_),
+ DelaySendChar(&loop_, 500, 'C', simulate_input::NONE)));
+
+ ie_mock_.ExpectNavigation(in_cf, kFormPostActionUrl);
+ EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostActionUrl)))
+ .WillOnce(testing::DoAll(
+ VerifyAddressBarUrl(&ie_mock_),
+ DelayGoBack(&ie_mock_, &loop_, 0)));
+
+ ie_mock_.ExpectNavigation(in_cf, kFormPostUrl);
+ EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostUrl)))
+ .WillOnce(testing::DoAll(
+ VerifyAddressBarUrl(&ie_mock_),
+ DelayGoForward(&ie_mock_, &loop_, 0)));
+
+ ie_mock_.ExpectNavigation(in_cf, kFormPostActionUrl);
+ EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(kFormPostActionUrl)))
+ .WillOnce(CloseBrowserMock(&ie_mock_));
+
+ LaunchIEAndNavigate(kFormPostUrl);
+}
+
+} // namespace chrome_frame_test
+