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

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DCHECK_IMPLIES(method == "POST", url.SchemeIs(http or https)). 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 (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 "chrome/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/files/file_util.h" 16 #include "base/files/file_util.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/memory/ref_counted_memory.h"
19 #include "base/path_service.h" 20 #include "base/path_service.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "base/test/test_timeouts.h" 23 #include "base/test/test_timeouts.h"
23 #include "base/time/time.h" 24 #include "base/time/time.h"
24 #include "build/build_config.h" 25 #include "build/build_config.h"
25 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 26 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
26 #include "chrome/browser/chrome_notification_types.h" 27 #include "chrome/browser/chrome_notification_types.h"
27 #include "chrome/browser/history/history_service_factory.h" 28 #include "chrome/browser/history/history_service_factory.h"
28 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 149 }
149 150
150 void NavigateToURL(chrome::NavigateParams* params) { 151 void NavigateToURL(chrome::NavigateParams* params) {
151 chrome::Navigate(params); 152 chrome::Navigate(params);
152 content::WaitForLoadStop(params->target_contents); 153 content::WaitForLoadStop(params->target_contents);
153 } 154 }
154 155
155 void NavigateToURLWithPost(Browser* browser, const GURL& url) { 156 void NavigateToURLWithPost(Browser* browser, const GURL& url) {
156 chrome::NavigateParams params(browser, url, 157 chrome::NavigateParams params(browser, url,
157 ui::PAGE_TRANSITION_FORM_SUBMIT); 158 ui::PAGE_TRANSITION_FORM_SUBMIT);
159
160 std::string post_data("test=body");
161 params.browser_initiated_post_data =
162 base::RefCountedString::TakeString(&post_data);
158 params.uses_post = true; 163 params.uses_post = true;
164
159 NavigateToURL(&params); 165 NavigateToURL(&params);
160 } 166 }
161 167
162 void NavigateToURL(Browser* browser, const GURL& url) { 168 void NavigateToURL(Browser* browser, const GURL& url) {
163 NavigateToURLWithDisposition(browser, url, CURRENT_TAB, 169 NavigateToURLWithDisposition(browser, url, CURRENT_TAB,
164 BROWSER_TEST_WAIT_FOR_NAVIGATION); 170 BROWSER_TEST_WAIT_FOR_NAVIGATION);
165 } 171 }
166 172
167 void NavigateToURLWithDispositionBlockUntilNavigationsComplete( 173 void NavigateToURLWithDispositionBlockUntilNavigationsComplete(
168 Browser* browser, 174 Browser* browser,
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 new content::MessageLoopRunner; 536 new content::MessageLoopRunner;
531 WaitHistoryLoadedObserver observer(runner.get()); 537 WaitHistoryLoadedObserver observer(runner.get());
532 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> 538 ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
533 scoped_observer(&observer); 539 scoped_observer(&observer);
534 scoped_observer.Add(history_service); 540 scoped_observer.Add(history_service);
535 runner->Run(); 541 runner->Run();
536 } 542 }
537 } 543 }
538 544
539 } // namespace ui_test_utils 545 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.h » ('j') | content/public/browser/navigation_handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698