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

Unified Diff: content/test/content_browser_test_utils.cc

Issue 10831056: Port the render_view_host_manager_browsertest.cc to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: content/test/content_browser_test_utils.cc
===================================================================
--- content/test/content_browser_test_utils.cc (revision 148713)
+++ content/test/content_browser_test_utils.cc (working copy)
@@ -64,4 +64,29 @@
runner->Run();
}
+ShellAddedObserver::ShellAddedObserver()
+ : shell_(NULL) {
+ Shell::SetShellCreatedCallback(
+ base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this)));
+}
+
+ShellAddedObserver::~ShellAddedObserver() {
+}
+
+Shell* ShellAddedObserver::GetShell() {
+ if (shell_)
+ return shell_;
+
+ runner_ = new MessageLoopRunner();
+ runner_->Run();
+ return shell_;
+}
+
+void ShellAddedObserver::ShellCreated(Shell* shell) {
+ DCHECK(!shell_);
+ shell_ = shell;
+ if (runner_)
+ runner_->QuitClosure().Run();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698