diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 20:14:29 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 20:14:29 +0000 |
commit | b9e2ecab97a8a7f3cce06951ab92a3eaef559206 (patch) | |
tree | 2ca050d7bb2742e5bada2d1cb508ddd5c7cf8144 /chrome | |
parent | c80950afb7ee003c3e069b80c3dd717a455ff685 (diff) | |
download | chromium_src-b9e2ecab97a8a7f3cce06951ab92a3eaef559206.zip chromium_src-b9e2ecab97a8a7f3cce06951ab92a3eaef559206.tar.gz chromium_src-b9e2ecab97a8a7f3cce06951ab92a3eaef559206.tar.bz2 |
Do not discount a MANUAL_SUBFRAME load just because it involved
some redirects.
R=brettw
BUG=21353
TEST=none
Review URL: http://codereview.chromium.org/246073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
5 files changed, 30 insertions, 9 deletions
diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc index 8d76583..473dc8b 100644 --- a/chrome/browser/session_history_uitest.cc +++ b/chrome/browser/session_history_uitest.cc @@ -23,10 +23,6 @@ const wchar_t kDocRoot[] = L"chrome/test/data"; class SessionHistoryTest : public UITest { protected: SessionHistoryTest() : UITest() { - FilePath path(test_data_directory_); - path = path.AppendASCII("session_history"); - - url_prefix_ = UTF8ToWide(net::FilePathToFileURL(path).spec()); } virtual void SetUp() { @@ -98,7 +94,6 @@ class SessionHistoryTest : public UITest { } protected: - wstring url_prefix_; scoped_refptr<BrowserProxy> window_; scoped_refptr<TabProxy> tab_; }; @@ -518,4 +513,21 @@ TEST_F(SessionHistoryTest, HistorySearchXSS) { EXPECT_EQ(L"History", GetTabTitle()); } +TEST_F(SessionHistoryTest, LocationChangeInSubframe) { + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot, NULL); + ASSERT_TRUE(server.get()); + + ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage( + "files/session_history/location_redirect.html"))); + EXPECT_EQ(L"Default Title", GetTabTitle()); + + ASSERT_TRUE(tab_->NavigateToURL(GURL( + "javascript:void(frames[0].navigate())"))); + EXPECT_EQ(L"foo", GetTabTitle()); + + ASSERT_TRUE(tab_->GoBack()); + EXPECT_EQ(L"Default Title", GetTabTitle()); +} + } // namespace diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index fddf3de..a1fa599 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -711,10 +711,6 @@ void NavigationController::RendererDidNavigateNewSubframe( // This is not user-initiated. Ignore. return; } - if (IsRedirect(params)) { - // This is redirect. Ignore. - return; - } // Manual subframe navigations just get the current entry cloned so the user // can go back or forward to it. The actual subframe information will be diff --git a/chrome/test/data/session_history/location_redirect.html b/chrome/test/data/session_history/location_redirect.html new file mode 100644 index 0000000..07f0f2a --- /dev/null +++ b/chrome/test/data/session_history/location_redirect.html @@ -0,0 +1,5 @@ +<title>Default Title</title> +<style> +iframe { width: 98%; height: 96%; } +</style> +<iframe src="location_redirect_frame1.html"></iframe> diff --git a/chrome/test/data/session_history/location_redirect_frame1.html b/chrome/test/data/session_history/location_redirect_frame1.html new file mode 100644 index 0000000..3b9c05e --- /dev/null +++ b/chrome/test/data/session_history/location_redirect_frame1.html @@ -0,0 +1,5 @@ +<script> +function navigate() { + location = "location_redirect_frame2.html"; +} +</script> diff --git a/chrome/test/data/session_history/location_redirect_frame2.html b/chrome/test/data/session_history/location_redirect_frame2.html new file mode 100644 index 0000000..21e040e --- /dev/null +++ b/chrome/test/data/session_history/location_redirect_frame2.html @@ -0,0 +1,3 @@ +<script> +parent.document.title = "foo"; +</script> |