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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 bool NavigateToURLAndExpectNoCommit(Shell* window, const GURL& url) { | 74 bool NavigateToURLAndExpectNoCommit(Shell* window, const GURL& url) { |
75 NavigationEntry* old_entry = | 75 NavigationEntry* old_entry = |
76 window->web_contents()->GetController().GetLastCommittedEntry(); | 76 window->web_contents()->GetController().GetLastCommittedEntry(); |
77 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); | 77 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); |
78 NavigationEntry* new_entry = | 78 NavigationEntry* new_entry = |
79 window->web_contents()->GetController().GetLastCommittedEntry(); | 79 window->web_contents()->GetController().GetLastCommittedEntry(); |
80 return old_entry == new_entry; | 80 return old_entry == new_entry; |
81 } | 81 } |
82 | 82 |
83 void WaitForAppModalDialog(Shell* window) { | 83 void WaitForAppModalDialog(Shell* window) { |
84 ShellJavaScriptDialogManager* dialog_manager= | 84 ShellJavaScriptDialogManager* dialog_manager = |
85 static_cast<ShellJavaScriptDialogManager*>( | 85 static_cast<ShellJavaScriptDialogManager*>( |
86 window->GetJavaScriptDialogManager()); | 86 window->GetJavaScriptDialogManager(window->web_contents())); |
87 | 87 |
88 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); | 88 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); |
89 dialog_manager->set_dialog_request_callback(runner->QuitClosure()); | 89 dialog_manager->set_dialog_request_callback(runner->QuitClosure()); |
90 runner->Run(); | 90 runner->Run(); |
91 } | 91 } |
92 | 92 |
93 ShellAddedObserver::ShellAddedObserver() | 93 ShellAddedObserver::ShellAddedObserver() |
94 : shell_(NULL) { | 94 : shell_(NULL) { |
95 Shell::SetShellCreatedCallback( | 95 Shell::SetShellCreatedCallback( |
96 base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this))); | 96 base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this))); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 bool WebContentsAddedObserver::RenderViewCreatedCalled() { | 164 bool WebContentsAddedObserver::RenderViewCreatedCalled() { |
165 if (child_observer_) | 165 if (child_observer_) |
166 return child_observer_->render_view_created_called_; | 166 return child_observer_->render_view_created_called_; |
167 | 167 |
168 return false; | 168 return false; |
169 } | 169 } |
170 | 170 |
171 } // namespace content | 171 } // namespace content |
OLD | NEW |