Chromium Code Reviews| Index: content/browser/web_contents/navigation_controller_impl_unittest.cc |
| diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| index e174bf8e83dfceeecfc79f9e193c4acdcf6f274b..f4a87b81bf4b24ff087fa28508e46ee849624750 100644 |
| --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc |
| @@ -563,6 +563,31 @@ TEST_F(NavigationControllerTest, LoadURL_RedirectAbortDoesntShowPendingURL) { |
| contents()->SetDelegate(NULL); |
| } |
| +// Test NavigationEntry is constructed correctly. No other logic tested. |
| +TEST_F(NavigationControllerTest, PostURL) { |
| + NavigationControllerImpl& controller = controller_impl(); |
| + |
| + const GURL url("http://foo1"); |
| + |
| + const int length = 5; |
| + const unsigned char* raw_data = |
| + reinterpret_cast<const unsigned char*>("d\n\0a2"); |
| + std::vector<unsigned char> post_data_vector(raw_data, raw_data+length); |
| + scoped_refptr<base::RefCountedBytes> data = |
| + base::RefCountedBytes::TakeVector(&post_data_vector); |
| + |
| + controller.PostURL(url, content::Referrer(), data, true); |
| + |
| + NavigationEntryImpl* post_entry = |
| + NavigationEntryImpl::FromNavigationEntry( |
| + controller.GetPendingEntry()); |
| + |
| + EXPECT_TRUE(post_entry); |
| + EXPECT_TRUE(post_entry->GetHasPostData()); |
|
Charlie Reis
2012/07/30 20:36:38
That's an awkward name. Should it be HasPostData(
boliu
2012/07/30 21:53:45
This is an existing method in NavigationEntry; I'm
|
| + EXPECT_EQ(data->front(), |
| + post_entry->GetBrowserInitiatedPostData()->front()); |
| +} |
| + |
| TEST_F(NavigationControllerTest, Reload) { |
| NavigationControllerImpl& controller = controller_impl(); |
| TestNotificationTracker notifications; |