| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 start_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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 "," | 2456 "," |
| 2457 "\"functionDeclaration\":\"function foo(){ " | 2457 "\"functionDeclaration\":\"function foo(){ " |
| 2458 "Promise.resolve().then(() => " | 2458 "Promise.resolve().then(() => " |
| 2459 "console.log(239))}\"" | 2459 "console.log(239))}\"" |
| 2460 "}" | 2460 "}" |
| 2461 "}"); | 2461 "}"); |
| 2462 EXPECT_EQ(1, CountNotifications("Console.messageAdded")); | 2462 EXPECT_EQ(1, CountNotifications("Console.messageAdded")); |
| 2463 } | 2463 } |
| 2464 | 2464 |
| 2465 } // namespace content | 2465 } // namespace content |
| OLD | NEW |