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

Unified Diff: chrome/test/ui_test_utils.cc

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/ui_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui_test_utils.cc
===================================================================
--- chrome/test/ui_test_utils.cc (revision 30521)
+++ chrome/test/ui_test_utils.cc (working copy)
@@ -503,4 +503,27 @@
RunMessageLoop();
}
+TimedMessageLoopRunner::TimedMessageLoopRunner()
+ : loop_(new MessageLoopForUI()),
+ owned_(true) {
+}
+
+TimedMessageLoopRunner::~TimedMessageLoopRunner() {
+ if (owned_)
+ delete loop_;
+}
+
+void TimedMessageLoopRunner::RunFor(int ms) {
+ QuitAfter(ms);
+ loop_->Run();
+}
+
+void TimedMessageLoopRunner::Quit() {
+ loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask);
+}
+
+void TimedMessageLoopRunner::QuitAfter(int ms) {
+ loop_->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, ms);
+}
+
} // namespace ui_test_utils
« no previous file with comments | « chrome/test/ui_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698