| Index: content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| index f67f7e6f9a2118486c0d69a4519367424cdfb6a1..3f85bee9dcd3c2143561a3488dcfbcb2937bcce7 100644
|
| --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
|
| @@ -41,6 +41,7 @@
|
| #include "content/public/common/browser_side_navigation_policy.h"
|
| #include "content/public/common/page_state.h"
|
| #include "content/public/common/page_type.h"
|
| +#include "content/public/common/resource_request_body.h"
|
| #include "content/public/common/url_constants.h"
|
| #include "content/public/test/mock_render_process_host.h"
|
| #include "content/public/test/test_notification_tracker.h"
|
| @@ -682,8 +683,7 @@ void CheckNavigationEntryMatchLoadParams(
|
| load_params.override_user_agent);
|
| EXPECT_EQ(should_override, entry->GetIsOverridingUserAgent());
|
| }
|
| - EXPECT_EQ(load_params.browser_initiated_post_data.get(),
|
| - entry->GetBrowserInitiatedPostData());
|
| + EXPECT_EQ(load_params.post_data, entry->GetPostData());
|
| EXPECT_EQ(load_params.transferred_global_request_id,
|
| entry->transferred_global_request_id());
|
| }
|
| @@ -755,18 +755,13 @@ TEST_F(NavigationControllerTest, LoadURLWithExtraParams_HttpPost) {
|
|
|
| NavigationController::LoadURLParams load_params(GURL("https://posturl"));
|
| load_params.transition_type = ui::PAGE_TRANSITION_TYPED;
|
| - load_params.load_type =
|
| - NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
|
| + load_params.load_type = NavigationController::LOAD_TYPE_HTTP_POST;
|
| load_params.override_user_agent = NavigationController::UA_OVERRIDE_TRUE;
|
|
|
| -
|
| - const unsigned char* raw_data =
|
| - reinterpret_cast<const unsigned char*>("d\n\0a2");
|
| + const char* raw_data = "d\n\0a2";
|
| const int length = 5;
|
| - std::vector<unsigned char> post_data_vector(raw_data, raw_data+length);
|
| - scoped_refptr<base::RefCountedBytes> data =
|
| - base::RefCountedBytes::TakeVector(&post_data_vector);
|
| - load_params.browser_initiated_post_data = data.get();
|
| + load_params.post_data =
|
| + ResourceRequestBody::CreateFromBytes(raw_data, length);
|
|
|
| controller.LoadURLWithParams(load_params);
|
| NavigationEntryImpl* entry = controller.GetPendingEntry();
|
| @@ -1576,22 +1571,19 @@ TEST_F(NavigationControllerTest, ResetEntryValuesAfterCommit) {
|
| entry_id = controller.GetPendingEntry()->GetUniqueID();
|
|
|
| // Set up some sample values.
|
| - const unsigned char* raw_data =
|
| - reinterpret_cast<const unsigned char*>("post\n\n\0data");
|
| + const char* raw_data = "post\n\n\0data";
|
| const int length = 11;
|
| - std::vector<unsigned char> post_data_vector(raw_data, raw_data+length);
|
| - scoped_refptr<base::RefCountedBytes> post_data =
|
| - base::RefCountedBytes::TakeVector(&post_data_vector);
|
| GlobalRequestID transfer_id(3, 4);
|
|
|
| // Set non-persisted values on the pending entry.
|
| NavigationEntryImpl* pending_entry = controller.GetPendingEntry();
|
| - pending_entry->SetBrowserInitiatedPostData(post_data.get());
|
| + pending_entry->SetPostData(
|
| + ResourceRequestBody::CreateFromBytes(raw_data, length));
|
| pending_entry->set_is_renderer_initiated(true);
|
| pending_entry->set_transferred_global_request_id(transfer_id);
|
| pending_entry->set_should_replace_entry(true);
|
| pending_entry->set_should_clear_history_list(true);
|
| - EXPECT_EQ(post_data.get(), pending_entry->GetBrowserInitiatedPostData());
|
| + EXPECT_TRUE(pending_entry->GetPostData());
|
| EXPECT_TRUE(pending_entry->is_renderer_initiated());
|
| EXPECT_EQ(transfer_id, pending_entry->transferred_global_request_id());
|
| EXPECT_TRUE(pending_entry->should_replace_entry());
|
| @@ -1604,7 +1596,7 @@ TEST_F(NavigationControllerTest, ResetEntryValuesAfterCommit) {
|
| // Certain values that are only used for pending entries get reset after
|
| // commit.
|
| NavigationEntryImpl* committed_entry = controller.GetLastCommittedEntry();
|
| - EXPECT_FALSE(committed_entry->GetBrowserInitiatedPostData());
|
| + EXPECT_FALSE(committed_entry->GetPostData());
|
| EXPECT_FALSE(committed_entry->is_renderer_initiated());
|
| EXPECT_EQ(GlobalRequestID(-1, -1),
|
| committed_entry->transferred_global_request_id());
|
|
|