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

Unified Diff: content/browser/frame_host/navigation_entry_impl_unittest.cc

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Patch Set: Rebasing... 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/frame_host/navigation_entry_impl_unittest.cc
diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc
index 0b239e08ed8b77147a67641a6d0628fb309e79ba..29b5fc4e789818442ee478fb9d7e7626d82589f5 100644
--- a/content/browser/frame_host/navigation_entry_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc
@@ -213,18 +213,15 @@ TEST_F(NavigationEntryTest, NavigationEntryAccessors) {
entry2_->SetIsOverridingUserAgent(true);
EXPECT_TRUE(entry2_->GetIsOverridingUserAgent());
- // Browser initiated post data
- EXPECT_EQ(NULL, entry1_->GetBrowserInitiatedPostData());
- EXPECT_EQ(NULL, entry2_->GetBrowserInitiatedPostData());
+ // Post data
+ EXPECT_FALSE(entry1_->GetPostData());
+ EXPECT_FALSE(entry2_->GetPostData());
const int length = 11;
- const unsigned char* raw_data =
- reinterpret_cast<const unsigned char*>("post\n\n\0data");
- std::vector<unsigned char> post_data_vector(raw_data, raw_data+length);
- scoped_refptr<base::RefCountedBytes> post_data =
- base::RefCountedBytes::TakeVector(&post_data_vector);
- entry2_->SetBrowserInitiatedPostData(post_data.get());
- EXPECT_EQ(post_data->front(),
- entry2_->GetBrowserInitiatedPostData()->front());
+ const char* raw_data = "post\n\n\0data";
+ scoped_refptr<ResourceRequestBody> post_data =
+ ResourceRequestBody::CreateFromBytes(raw_data, length);
+ entry2_->SetPostData(post_data);
+ EXPECT_EQ(post_data, entry2_->GetPostData());
}
// Test basic Clone behavior.
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/net/network_errors_listing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698