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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
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
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <deque> 6 #include <deque>
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 #include "content/public/browser/navigation_controller.h" 87 #include "content/public/browser/navigation_controller.h"
88 #include "content/public/browser/navigation_entry.h" 88 #include "content/public/browser/navigation_entry.h"
89 #include "content/public/browser/notification_service.h" 89 #include "content/public/browser/notification_service.h"
90 #include "content/public/browser/render_frame_host.h" 90 #include "content/public/browser/render_frame_host.h"
91 #include "content/public/browser/render_process_host.h" 91 #include "content/public/browser/render_process_host.h"
92 #include "content/public/browser/render_view_host.h" 92 #include "content/public/browser/render_view_host.h"
93 #include "content/public/browser/site_instance.h" 93 #include "content/public/browser/site_instance.h"
94 #include "content/public/browser/web_contents.h" 94 #include "content/public/browser/web_contents.h"
95 #include "content/public/browser/web_contents_observer.h" 95 #include "content/public/browser/web_contents_observer.h"
96 #include "content/public/common/content_switches.h" 96 #include "content/public/common/content_switches.h"
97 #include "content/public/common/resource_request_body.h"
97 #include "content/public/common/url_constants.h" 98 #include "content/public/common/url_constants.h"
98 #include "content/public/test/browser_test_utils.h" 99 #include "content/public/test/browser_test_utils.h"
99 #include "content/public/test/ppapi_test_utils.h" 100 #include "content/public/test/ppapi_test_utils.h"
100 #include "content/public/test/test_navigation_observer.h" 101 #include "content/public/test/test_navigation_observer.h"
101 #include "content/public/test/test_utils.h" 102 #include "content/public/test/test_utils.h"
102 #include "extensions/common/constants.h" 103 #include "extensions/common/constants.h"
103 #include "extensions/common/extension_urls.h" 104 #include "extensions/common/extension_urls.h"
104 #include "extensions/common/manifest_handlers/mime_types_handler.h" 105 #include "extensions/common/manifest_handlers/mime_types_handler.h"
105 #include "extensions/common/switches.h" 106 #include "extensions/common/switches.h"
106 #include "extensions/test/result_catcher.h" 107 #include "extensions/test/result_catcher.h"
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after
3690 // POST data. 3691 // POST data.
3691 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 3692 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
3692 PrerenderBrowserInitiatedPostNoSwap) { 3693 PrerenderBrowserInitiatedPostNoSwap) {
3693 PrerenderTestURL("/prerender/prerender_page.html", 3694 PrerenderTestURL("/prerender/prerender_page.html",
3694 FINAL_STATUS_APP_TERMINATING, 1); 3695 FINAL_STATUS_APP_TERMINATING, 1);
3695 3696
3696 std::string post_data = "DATA"; 3697 std::string post_data = "DATA";
3697 content::OpenURLParams params(dest_url(), Referrer(), CURRENT_TAB, 3698 content::OpenURLParams params(dest_url(), Referrer(), CURRENT_TAB,
3698 ui::PAGE_TRANSITION_TYPED, false); 3699 ui::PAGE_TRANSITION_TYPED, false);
3699 params.uses_post = true; 3700 params.uses_post = true;
3700 params.browser_initiated_post_data = 3701 params.post_data = content::ResourceRequestBody::CreateFromBytes(
3701 base::RefCountedString::TakeString(&post_data); 3702 post_data.data(), post_data.size());
3702 NavigateToURLWithParams(params, false); 3703 NavigateToURLWithParams(params, false);
3703 } 3704 }
3704 3705
3705 // Checks that the prerendering of a page is canceled correctly when the 3706 // Checks that the prerendering of a page is canceled correctly when the
3706 // prerendered page tries to make a second navigation entry. 3707 // prerendered page tries to make a second navigation entry.
3707 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNewNavigationEntry) { 3708 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNewNavigationEntry) {
3708 PrerenderTestURL("/prerender/prerender_new_entry.html", 3709 PrerenderTestURL("/prerender/prerender_new_entry.html",
3709 FINAL_STATUS_NEW_NAVIGATION_ENTRY, 1); 3710 FINAL_STATUS_NEW_NAVIGATION_ENTRY, 1);
3710 } 3711 }
3711 3712
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 browser()->tab_strip_model()->GetActiveWebContents(); 3925 browser()->tab_strip_model()->GetActiveWebContents();
3925 bool display_test_result = false; 3926 bool display_test_result = false;
3926 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, 3927 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents,
3927 "DidDisplayReallyPass()", 3928 "DidDisplayReallyPass()",
3928 &display_test_result)); 3929 &display_test_result));
3929 ASSERT_TRUE(display_test_result); 3930 ASSERT_TRUE(display_test_result);
3930 } 3931 }
3931 #endif // !defined(DISABLE_NACL) 3932 #endif // !defined(DISABLE_NACL)
3932 3933
3933 } // namespace prerender 3934 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698