| 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 25 matching lines...) Expand all Loading... |
| 36 const GURL& url, | 36 const GURL& url, |
| 37 int number_of_navigations) { | 37 int number_of_navigations) { |
| 38 WaitForLoadStop(window->web_contents()); | 38 WaitForLoadStop(window->web_contents()); |
| 39 TestNavigationObserver same_tab_observer(window->web_contents(), | 39 TestNavigationObserver same_tab_observer(window->web_contents(), |
| 40 number_of_navigations); | 40 number_of_navigations); |
| 41 | 41 |
| 42 window->LoadURL(url); | 42 window->LoadURL(url); |
| 43 same_tab_observer.Wait(); | 43 same_tab_observer.Wait(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void LoadDataWithBaseURL(Shell* window, const GURL& url, |
| 47 const std::string data, const GURL& base_url) { |
| 48 WaitForLoadStop(window->web_contents()); |
| 49 TestNavigationObserver same_tab_observer(window->web_contents(), 1); |
| 50 |
| 51 window->LoadDataWithBaseURL(url, data, base_url); |
| 52 same_tab_observer.Wait(); |
| 53 } |
| 54 |
| 46 void NavigateToURL(Shell* window, const GURL& url) { | 55 void NavigateToURL(Shell* window, const GURL& url) { |
| 47 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); | 56 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); |
| 48 } | 57 } |
| 49 | 58 |
| 50 void WaitForAppModalDialog(Shell* window) { | 59 void WaitForAppModalDialog(Shell* window) { |
| 51 ShellJavaScriptDialogManager* dialog_manager= | 60 ShellJavaScriptDialogManager* dialog_manager= |
| 52 static_cast<ShellJavaScriptDialogManager*>( | 61 static_cast<ShellJavaScriptDialogManager*>( |
| 53 window->GetJavaScriptDialogManager()); | 62 window->GetJavaScriptDialogManager()); |
| 54 | 63 |
| 55 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); | 64 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 } | 85 } |
| 77 | 86 |
| 78 void ShellAddedObserver::ShellCreated(Shell* shell) { | 87 void ShellAddedObserver::ShellCreated(Shell* shell) { |
| 79 DCHECK(!shell_); | 88 DCHECK(!shell_); |
| 80 shell_ = shell; | 89 shell_ = shell; |
| 81 if (runner_.get()) | 90 if (runner_.get()) |
| 82 runner_->QuitClosure().Run(); | 91 runner_->QuitClosure().Run(); |
| 83 } | 92 } |
| 84 | 93 |
| 85 } // namespace content | 94 } // namespace content |
| OLD | NEW |