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

Unified Diff: content/test/content_browser_test_utils.h

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.h
===================================================================
--- content/test/content_browser_test_utils.h (revision 148713)
+++ content/test/content_browser_test_utils.h (working copy)
@@ -5,6 +5,7 @@
#ifndef CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_
#define CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_H_
+#include "base/memory/ref_counted.h"
#include "googleurl/src/gurl.h"
#include "ui/gfx/native_widget_types.h"
@@ -20,6 +21,7 @@
namespace content {
+class MessageLoopRunner;
class Shell;
// Generate the file path for testing a particular test.
@@ -47,6 +49,26 @@
// Wait until an application modal dialog is requested.
void WaitForAppModalDialog(Shell* window);
+// Used to wait for a new Shell window to be created. Instantiate this object
+// before the operation that will create the window.
+class ShellAddedObserver {
+ public:
+ ShellAddedObserver();
+ ~ShellAddedObserver();
+
+ // Will run a message loop to wait for the new window if it hasn't been
+ // created since the constructor.
+ Shell* GetShell();
+
+ private:
+ void ShellCreated(Shell* shell);
+
+ Shell* shell_;
+ scoped_refptr<MessageLoopRunner> runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(ShellAddedObserver);
+};
+
#if defined OS_MACOSX
void SetWindowBounds(gfx::NativeWindow window, const gfx::Rect& bounds);
#endif

Powered by Google App Engine
This is Rietveld 408576698