| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 5825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5836 EXPECT_EQ(2, controller.GetEntryCount()); | 5836 EXPECT_EQ(2, controller.GetEntryCount()); |
| 5837 { | 5837 { |
| 5838 NavigationEntryImpl* entry = controller.GetLastCommittedEntry(); | 5838 NavigationEntryImpl* entry = controller.GetLastCommittedEntry(); |
| 5839 FrameNavigationEntry* root_entry = entry->GetFrameEntry(root); | 5839 FrameNavigationEntry* root_entry = entry->GetFrameEntry(root); |
| 5840 FrameNavigationEntry* frame_entry = entry->GetFrameEntry(frame); | 5840 FrameNavigationEntry* frame_entry = entry->GetFrameEntry(frame); |
| 5841 EXPECT_NE(nullptr, root_entry); | 5841 EXPECT_NE(nullptr, root_entry); |
| 5842 EXPECT_NE(nullptr, frame_entry); | 5842 EXPECT_NE(nullptr, frame_entry); |
| 5843 EXPECT_EQ("GET", root_entry->method()); | 5843 EXPECT_EQ("GET", root_entry->method()); |
| 5844 EXPECT_EQ(-1, root_entry->post_id()); | 5844 EXPECT_EQ(-1, root_entry->post_id()); |
| 5845 EXPECT_EQ("POST", frame_entry->method()); | 5845 EXPECT_EQ("POST", frame_entry->method()); |
| 5846 // TODO(clamy): Check the post id as well when PlzNavigate handles it | 5846 EXPECT_NE(-1, frame_entry->post_id()); |
| 5847 // properly. | |
| 5848 if (!IsBrowserSideNavigationEnabled()) | |
| 5849 EXPECT_NE(-1, frame_entry->post_id()); | |
| 5850 EXPECT_FALSE(entry->GetHasPostData()); | 5847 EXPECT_FALSE(entry->GetHasPostData()); |
| 5851 EXPECT_EQ(-1, entry->GetPostID()); | 5848 EXPECT_EQ(-1, entry->GetPostID()); |
| 5852 } | 5849 } |
| 5853 } | 5850 } |
| 5854 | 5851 |
| 5855 // Tests that POST body is not lost when decidePolicyForNavigation tells the | 5852 // Tests that POST body is not lost when decidePolicyForNavigation tells the |
| 5856 // renderer to route the request via FrameHostMsg_OpenURL sent to the browser. | 5853 // renderer to route the request via FrameHostMsg_OpenURL sent to the browser. |
| 5857 // See also https://crbug.com/344348. | 5854 // See also https://crbug.com/344348. |
| 5858 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, PostViaOpenUrlMsg) { | 5855 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, PostViaOpenUrlMsg) { |
| 5859 GURL main_url( | 5856 GURL main_url( |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6867 EXPECT_EQ(1, controller.GetLastCommittedEntryIndex()); | 6864 EXPECT_EQ(1, controller.GetLastCommittedEntryIndex()); |
| 6868 EXPECT_FALSE( | 6865 EXPECT_FALSE( |
| 6869 controller.GetLastCommittedEntry()->GetURL().SchemeIs(url::kDataScheme)); | 6866 controller.GetLastCommittedEntry()->GetURL().SchemeIs(url::kDataScheme)); |
| 6870 EXPECT_EQ(redirect_to_unsafe_url, | 6867 EXPECT_EQ(redirect_to_unsafe_url, |
| 6871 controller.GetLastCommittedEntry()->GetVirtualURL()); | 6868 controller.GetLastCommittedEntry()->GetVirtualURL()); |
| 6872 EXPECT_EQ(url::kAboutBlankURL, | 6869 EXPECT_EQ(url::kAboutBlankURL, |
| 6873 controller.GetLastCommittedEntry()->GetURL().spec()); | 6870 controller.GetLastCommittedEntry()->GetURL().spec()); |
| 6874 } | 6871 } |
| 6875 | 6872 |
| 6876 } // namespace content | 6873 } // namespace content |
| OLD | NEW |