OLD | NEW |
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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 common_params.url = GURL("data:text/html,<div>Page</div>"); | 603 common_params.url = GURL("data:text/html,<div>Page</div>"); |
604 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 604 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
605 common_params.transition = ui::PAGE_TRANSITION_TYPED; | 605 common_params.transition = ui::PAGE_TRANSITION_TYPED; |
606 common_params.method = "POST"; | 606 common_params.method = "POST"; |
607 request_params.page_id = -1; | 607 request_params.page_id = -1; |
608 | 608 |
609 // Set up post data. | 609 // Set up post data. |
610 const unsigned char* raw_data = reinterpret_cast<const unsigned char*>( | 610 const unsigned char* raw_data = reinterpret_cast<const unsigned char*>( |
611 "post \0\ndata"); | 611 "post \0\ndata"); |
612 const unsigned int length = 11; | 612 const unsigned int length = 11; |
613 const std::vector<unsigned char> post_data(raw_data, raw_data + length); | 613 scoped_refptr<ResourceRequestBody> post_data(new ResourceRequestBody); |
614 start_params.browser_initiated_post_data = post_data; | 614 post_data->AppendBytes(raw_data, raw_data + length); |
| 615 start_params.post_data = post_data; |
615 | 616 |
616 frame()->Navigate(common_params, start_params, request_params); | 617 frame()->Navigate(common_params, start_params, request_params); |
617 ProcessPendingMessages(); | 618 ProcessPendingMessages(); |
618 | 619 |
619 const IPC::Message* frame_navigate_msg = | 620 const IPC::Message* frame_navigate_msg = |
620 render_thread_->sink().GetUniqueMessageMatching( | 621 render_thread_->sink().GetUniqueMessageMatching( |
621 FrameHostMsg_DidCommitProvisionalLoad::ID); | 622 FrameHostMsg_DidCommitProvisionalLoad::ID); |
622 EXPECT_TRUE(frame_navigate_msg); | 623 EXPECT_TRUE(frame_navigate_msg); |
623 | 624 |
624 FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params; | 625 FrameHostMsg_DidCommitProvisionalLoad::Param host_nav_params; |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 "," | 2456 "," |
2456 "\"functionDeclaration\":\"function foo(){ " | 2457 "\"functionDeclaration\":\"function foo(){ " |
2457 "Promise.resolve().then(() => " | 2458 "Promise.resolve().then(() => " |
2458 "console.log(239))}\"" | 2459 "console.log(239))}\"" |
2459 "}" | 2460 "}" |
2460 "}"); | 2461 "}"); |
2461 EXPECT_EQ(1, CountNotifications("Console.messageAdded")); | 2462 EXPECT_EQ(1, CountNotifications("Console.messageAdded")); |
2462 } | 2463 } |
2463 | 2464 |
2464 } // namespace content | 2465 } // namespace content |
OLD | NEW |