| 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 "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 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "content/public/browser/download_manager.h" | 52 #include "content/public/browser/download_manager.h" |
| 53 #include "content/public/browser/geolocation_provider.h" | 53 #include "content/public/browser/geolocation_provider.h" |
| 54 #include "content/public/browser/navigation_controller.h" | 54 #include "content/public/browser/navigation_controller.h" |
| 55 #include "content/public/browser/navigation_entry.h" | 55 #include "content/public/browser/navigation_entry.h" |
| 56 #include "content/public/browser/notification_service.h" | 56 #include "content/public/browser/notification_service.h" |
| 57 #include "content/public/browser/render_process_host.h" | 57 #include "content/public/browser/render_process_host.h" |
| 58 #include "content/public/browser/storage_partition.h" | 58 #include "content/public/browser/storage_partition.h" |
| 59 #include "content/public/browser/web_contents.h" | 59 #include "content/public/browser/web_contents.h" |
| 60 #include "content/public/browser/web_contents_observer.h" | 60 #include "content/public/browser/web_contents_observer.h" |
| 61 #include "content/public/common/geoposition.h" | 61 #include "content/public/common/geoposition.h" |
| 62 #include "content/public/common/resource_request_body.h" |
| 62 #include "content/public/test/browser_test_utils.h" | 63 #include "content/public/test/browser_test_utils.h" |
| 63 #include "content/public/test/download_test_observer.h" | 64 #include "content/public/test/download_test_observer.h" |
| 64 #include "content/public/test/test_navigation_observer.h" | 65 #include "content/public/test/test_navigation_observer.h" |
| 65 #include "content/public/test/test_utils.h" | 66 #include "content/public/test/test_utils.h" |
| 66 #include "net/base/filename_util.h" | 67 #include "net/base/filename_util.h" |
| 67 #include "net/cookies/cookie_constants.h" | 68 #include "net/cookies/cookie_constants.h" |
| 68 #include "net/cookies/cookie_monster.h" | 69 #include "net/cookies/cookie_monster.h" |
| 69 #include "net/cookies/cookie_store.h" | 70 #include "net/cookies/cookie_store.h" |
| 70 #include "net/test/python_utils.h" | 71 #include "net/test/python_utils.h" |
| 71 #include "net/url_request/url_request_context.h" | 72 #include "net/url_request/url_request_context.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void NavigateToURL(chrome::NavigateParams* params) { | 152 void NavigateToURL(chrome::NavigateParams* params) { |
| 152 chrome::Navigate(params); | 153 chrome::Navigate(params); |
| 153 content::WaitForLoadStop(params->target_contents); | 154 content::WaitForLoadStop(params->target_contents); |
| 154 } | 155 } |
| 155 | 156 |
| 156 void NavigateToURLWithPost(Browser* browser, const GURL& url) { | 157 void NavigateToURLWithPost(Browser* browser, const GURL& url) { |
| 157 chrome::NavigateParams params(browser, url, | 158 chrome::NavigateParams params(browser, url, |
| 158 ui::PAGE_TRANSITION_FORM_SUBMIT); | 159 ui::PAGE_TRANSITION_FORM_SUBMIT); |
| 159 | 160 |
| 160 std::string post_data("test=body"); | 161 std::string post_data("test=body"); |
| 161 params.browser_initiated_post_data = | 162 params.post_data = content::ResourceRequestBody::CreateFromBytes(post_data); |
| 162 base::RefCountedString::TakeString(&post_data); | |
| 163 params.uses_post = true; | 163 params.uses_post = true; |
| 164 | 164 |
| 165 NavigateToURL(¶ms); | 165 NavigateToURL(¶ms); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void NavigateToURL(Browser* browser, const GURL& url) { | 168 void NavigateToURL(Browser* browser, const GURL& url) { |
| 169 NavigateToURLWithDisposition(browser, url, CURRENT_TAB, | 169 NavigateToURLWithDisposition(browser, url, CURRENT_TAB, |
| 170 BROWSER_TEST_WAIT_FOR_NAVIGATION); | 170 BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 171 } | 171 } |
| 172 | 172 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 new content::MessageLoopRunner; | 536 new content::MessageLoopRunner; |
| 537 WaitHistoryLoadedObserver observer(runner.get()); | 537 WaitHistoryLoadedObserver observer(runner.get()); |
| 538 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 538 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
| 539 scoped_observer(&observer); | 539 scoped_observer(&observer); |
| 540 scoped_observer.Add(history_service); | 540 scoped_observer.Add(history_service); |
| 541 runner->Run(); | 541 runner->Run(); |
| 542 } | 542 } |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace ui_test_utils | 545 } // namespace ui_test_utils |
| OLD | NEW |