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

Unified Diff: chrome/test/ui_test_utils.h

Issue 339009: GMocking Externaltab tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.cc ('k') | chrome/test/ui_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui_test_utils.h
===================================================================
--- chrome/test/ui_test_utils.h (revision 30521)
+++ chrome/test/ui_test_utils.h (working copy)
@@ -17,6 +17,7 @@
class Browser;
class DownloadManager;
class GURL;
+class MessageLoop;
class NavigationController;
class RenderViewHost;
class TabContents;
@@ -135,6 +136,34 @@
NotificationObserver* observer,
int64 timeout_ms);
+// Run a message loop only for the specified amount of time.
+class TimedMessageLoopRunner {
+ public:
+ // Create new MessageLoopForUI and attach to it.
+ TimedMessageLoopRunner();
+
+ // Attach to an existing message loop.
+ explicit TimedMessageLoopRunner(MessageLoop* loop)
+ : loop_(loop), owned_(false) {}
+
+ ~TimedMessageLoopRunner();
+
+ // Run the message loop for ms milliseconds.
+ void RunFor(int ms);
+
+ // Post Quit task to the message loop.
+ void Quit();
+
+ // Post delayed Quit task to the message loop.
+ void QuitAfter(int ms);
+
+ private:
+ MessageLoop* loop_;
+ bool owned_;
+
+ DISALLOW_COPY_AND_ASSIGN(TimedMessageLoopRunner);
+};
+
} // namespace ui_test_utils
#endif // CHROME_TEST_UI_TEST_UTILS_H_
« no previous file with comments | « chrome/test/automation/automation_proxy_uitest.cc ('k') | chrome/test/ui_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698