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

Side by Side Diff: content/public/test/content_browser_test_utils.cc

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 window->LoadDataWithBaseURL(url, data, base_url); 62 window->LoadDataWithBaseURL(url, data, base_url);
63 same_tab_observer.Wait(); 63 same_tab_observer.Wait();
64 } 64 }
65 65
66 void NavigateToURL(Shell* window, const GURL& url) { 66 void NavigateToURL(Shell* window, const GURL& url) {
67 NavigateToURLBlockUntilNavigationsComplete(window, url, 1); 67 NavigateToURLBlockUntilNavigationsComplete(window, url, 1);
68 } 68 }
69 69
70 void WaitForAppModalDialog(Shell* window) { 70 void WaitForAppModalDialog(Shell* window) {
71 ShellJavaScriptDialogManager* dialog_manager= 71 ShellJavaScriptDialogManager* dialog_manager =
72 static_cast<ShellJavaScriptDialogManager*>( 72 static_cast<ShellJavaScriptDialogManager*>(
73 window->GetJavaScriptDialogManager()); 73 window->GetJavaScriptDialogManager(window->web_contents()));
74 74
75 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); 75 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner();
76 dialog_manager->set_dialog_request_callback(runner->QuitClosure()); 76 dialog_manager->set_dialog_request_callback(runner->QuitClosure());
77 runner->Run(); 77 runner->Run();
78 } 78 }
79 79
80 ShellAddedObserver::ShellAddedObserver() 80 ShellAddedObserver::ShellAddedObserver()
81 : shell_(NULL) { 81 : shell_(NULL) {
82 Shell::SetShellCreatedCallback( 82 Shell::SetShellCreatedCallback(
83 base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this))); 83 base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this)));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 bool WebContentsAddedObserver::RenderViewCreatedCalled() { 151 bool WebContentsAddedObserver::RenderViewCreatedCalled() {
152 if (child_observer_) 152 if (child_observer_)
153 return child_observer_->render_view_created_called_; 153 return child_observer_->render_view_created_called_;
154 154
155 return false; 155 return false;
156 } 156 }
157 157
158 } // namespace content 158 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698