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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl_unittest.cc

Issue 2022483003: ABANDONED CL: LoadURLParams: Add |method| + removing LOAD_TYPE_BROWSER_INITIATED_HTTP_POST. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@post-data-my-stuff
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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 748
749 CheckNavigationEntryMatchLoadParams(load_params, entry); 749 CheckNavigationEntryMatchLoadParams(load_params, entry);
750 } 750 }
751 #endif 751 #endif
752 752
753 TEST_F(NavigationControllerTest, LoadURLWithExtraParams_HttpPost) { 753 TEST_F(NavigationControllerTest, LoadURLWithExtraParams_HttpPost) {
754 NavigationControllerImpl& controller = controller_impl(); 754 NavigationControllerImpl& controller = controller_impl();
755 755
756 NavigationController::LoadURLParams load_params(GURL("https://posturl")); 756 NavigationController::LoadURLParams load_params(GURL("https://posturl"));
757 load_params.transition_type = ui::PAGE_TRANSITION_TYPED; 757 load_params.transition_type = ui::PAGE_TRANSITION_TYPED;
758 load_params.load_type = 758 load_params.method = "POST";
759 NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST;
760 load_params.override_user_agent = NavigationController::UA_OVERRIDE_TRUE; 759 load_params.override_user_agent = NavigationController::UA_OVERRIDE_TRUE;
761 760
762
763 const unsigned char* raw_data = 761 const unsigned char* raw_data =
764 reinterpret_cast<const unsigned char*>("d\n\0a2"); 762 reinterpret_cast<const unsigned char*>("d\n\0a2");
765 const int length = 5; 763 const int length = 5;
766 std::vector<unsigned char> post_data_vector(raw_data, raw_data+length); 764 std::vector<unsigned char> post_data_vector(raw_data, raw_data+length);
767 scoped_refptr<base::RefCountedBytes> data = 765 scoped_refptr<base::RefCountedBytes> data =
768 base::RefCountedBytes::TakeVector(&post_data_vector); 766 base::RefCountedBytes::TakeVector(&post_data_vector);
769 load_params.browser_initiated_post_data = data.get(); 767 load_params.browser_initiated_post_data = data.get();
770 768
771 controller.LoadURLWithParams(load_params); 769 controller.LoadURLWithParams(load_params);
772 NavigationEntryImpl* entry = controller.GetPendingEntry(); 770 NavigationEntryImpl* entry = controller.GetPendingEntry();
(...skipping 4552 matching lines...) Expand 10 before | Expand all | Expand 10 after
5325 observer.details().ssl_status.num_unknown_scts); 5323 observer.details().ssl_status.num_unknown_scts);
5326 EXPECT_EQ(default_ssl_status.num_invalid_scts, 5324 EXPECT_EQ(default_ssl_status.num_invalid_scts,
5327 observer.details().ssl_status.num_invalid_scts); 5325 observer.details().ssl_status.num_invalid_scts);
5328 EXPECT_EQ(default_ssl_status.num_valid_scts, 5326 EXPECT_EQ(default_ssl_status.num_valid_scts,
5329 observer.details().ssl_status.num_valid_scts); 5327 observer.details().ssl_status.num_valid_scts);
5330 5328
5331 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count()); 5329 EXPECT_EQ(1, main_test_rfh()->GetProcess()->bad_msg_count());
5332 } 5330 }
5333 5331
5334 } // namespace content 5332 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698