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

Unified Diff: content/browser/web_contents/navigation_controller_impl_unittest.cc

Issue 10829044: Implement NavigationControllerWebView.PostURL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes according to comments. Improve render_view test. Created 8 years, 5 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/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..d89c67f2f449c3b7f82a80c68fbd5786da885af8 100644
--- a/content/browser/web_contents/navigation_controller_impl_unittest.cc
+++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc
@@ -563,6 +563,26 @@ 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 char* raw_data = "d\n\0a2";
+ const int raw_data_length = 5;
+ const std::vector<char> data(raw_data, raw_data + raw_data_length);
+
+ controller.PostURL(url, content::Referrer(), data, true);
+
+ NavigationEntryImpl* post_entry =
+ NavigationEntryImpl::FromNavigationEntry(
+ controller.GetPendingEntry());
+
+ EXPECT_TRUE(post_entry);
+ EXPECT_TRUE(post_entry->GetHasPostData());
+ EXPECT_EQ(data, post_entry->GetBrowserInitiatedPostData());
+}
+
TEST_F(NavigationControllerTest, Reload) {
NavigationControllerImpl& controller = controller_impl();
TestNotificationTracker notifications;

Powered by Google App Engine
This is Rietveld 408576698