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 "content/public/test/content_browser_test_utils.h" | 5 #include "content/public/test/content_browser_test_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void ReloadBlockUntilNavigationsComplete(Shell* window, | 46 void ReloadBlockUntilNavigationsComplete(Shell* window, |
47 int number_of_navigations) { | 47 int number_of_navigations) { |
48 WaitForLoadStop(window->web_contents()); | 48 WaitForLoadStop(window->web_contents()); |
49 TestNavigationObserver same_tab_observer(window->web_contents(), | 49 TestNavigationObserver same_tab_observer(window->web_contents(), |
50 number_of_navigations); | 50 number_of_navigations); |
51 | 51 |
52 window->Reload(); | 52 window->Reload(); |
53 same_tab_observer.Wait(); | 53 same_tab_observer.Wait(); |
54 } | 54 } |
55 | 55 |
56 void LoadDataWithBaseURL(Shell* window, const GURL& url, | 56 void LoadDataWithBaseURL(Shell* window, |
57 const std::string data, const GURL& base_url) { | 57 const GURL& url, |
| 58 const std::string& data, |
| 59 const GURL& base_url) { |
58 WaitForLoadStop(window->web_contents()); | 60 WaitForLoadStop(window->web_contents()); |
59 TestNavigationObserver same_tab_observer(window->web_contents(), 1); | 61 TestNavigationObserver same_tab_observer(window->web_contents(), 1); |
60 | 62 |
61 window->LoadDataWithBaseURL(url, data, base_url); | 63 window->LoadDataWithBaseURL(url, data, base_url); |
62 same_tab_observer.Wait(); | 64 same_tab_observer.Wait(); |
63 } | 65 } |
64 | 66 |
65 bool NavigateToURL(Shell* window, const GURL& url) { | 67 bool NavigateToURL(Shell* window, const GURL& url) { |
66 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); | 68 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); |
67 if (!IsLastCommittedEntryOfPageType(window->web_contents(), | 69 if (!IsLastCommittedEntryOfPageType(window->web_contents(), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 111 |
110 void ShellAddedObserver::ShellCreated(Shell* shell) { | 112 void ShellAddedObserver::ShellCreated(Shell* shell) { |
111 DCHECK(!shell_); | 113 DCHECK(!shell_); |
112 shell_ = shell; | 114 shell_ = shell; |
113 if (runner_.get()) | 115 if (runner_.get()) |
114 runner_->QuitClosure().Run(); | 116 runner_->QuitClosure().Run(); |
115 } | 117 } |
116 | 118 |
117 | 119 |
118 } // namespace content | 120 } // namespace content |
OLD | NEW |