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

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
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | content/shell/browser/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698