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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 1999943002: Moving HTTP POST body from StartNavigationParams to CommonNavigationParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 CommonNavigationParams common_params; 601 CommonNavigationParams common_params;
602 StartNavigationParams start_params; 602 StartNavigationParams start_params;
603 RequestNavigationParams request_params; 603 RequestNavigationParams request_params;
604 common_params.url = GURL("data:text/html,<div>Page</div>"); 604 common_params.url = GURL("data:text/html,<div>Page</div>");
605 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; 605 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL;
606 common_params.transition = ui::PAGE_TRANSITION_TYPED; 606 common_params.transition = ui::PAGE_TRANSITION_TYPED;
607 common_params.method = "POST"; 607 common_params.method = "POST";
608 request_params.page_id = -1; 608 request_params.page_id = -1;
609 609
610 // Set up post data. 610 // Set up post data.
611 const unsigned char* raw_data = reinterpret_cast<const unsigned char*>( 611 const char raw_data[] = "post \0\ndata";
612 "post \0\ndata"); 612 const size_t length = arraysize(raw_data);
613 const unsigned int length = 11; 613 scoped_refptr<ResourceRequestBody> post_data(new ResourceRequestBody);
614 const std::vector<unsigned char> post_data(raw_data, raw_data + length); 614 post_data->AppendBytes(raw_data, length);
615 start_params.browser_initiated_post_data = post_data; 615 common_params.post_data = post_data;
616 616
617 frame()->Navigate(common_params, start_params, request_params); 617 frame()->Navigate(common_params, start_params, request_params);
618 ProcessPendingMessages(); 618 ProcessPendingMessages();
619 619
620 const IPC::Message* frame_navigate_msg = 620 const IPC::Message* frame_navigate_msg =
621 render_thread_->sink().GetUniqueMessageMatching( 621 render_thread_->sink().GetUniqueMessageMatching(
622 FrameHostMsg_DidCommitProvisionalLoad::ID); 622 FrameHostMsg_DidCommitProvisionalLoad::ID);
623 EXPECT_TRUE(frame_navigate_msg); 623 EXPECT_TRUE(frame_navigate_msg);
624 624
625 FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params; 625 FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params;
(...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 "," 2475 ","
2476 "\"functionDeclaration\":\"function foo(){ " 2476 "\"functionDeclaration\":\"function foo(){ "
2477 "Promise.resolve().then(() => " 2477 "Promise.resolve().then(() => "
2478 "console.log(239))}\"" 2478 "console.log(239))}\""
2479 "}" 2479 "}"
2480 "}"); 2480 "}");
2481 EXPECT_EQ(1, CountNotifications("Console.messageAdded")); 2481 EXPECT_EQ(1, CountNotifications("Console.messageAdded"));
2482 } 2482 }
2483 2483
2484 } // namespace content 2484 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698