diff options
author | stoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 22:20:47 +0000 |
---|---|---|
committer | stoyan@google.com <stoyan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 22:20:47 +0000 |
commit | 41a1bc26f37b948b2793e6807c9822897a1f504d (patch) | |
tree | 8eb0a52c4ad6c435f43e387cec358aad573c35b7 /chrome/test/ui_test_utils.cc | |
parent | 74d1eecc72f97cb759ea252d8838f5ee46670938 (diff) | |
download | chromium_src-41a1bc26f37b948b2793e6807c9822897a1f504d.zip chromium_src-41a1bc26f37b948b2793e6807c9822897a1f504d.tar.gz chromium_src-41a1bc26f37b948b2793e6807c9822897a1f504d.tar.bz2 |
GMocking Externaltab tests.
Yet I cannot delete AutomationProxyForExternalTab because it is used by extension_uitest.cc.
Enable some tests meanwhile - now they should be stable enough.
BUG=18797,24664
TEST=ui_tests ok
Review URL: http://codereview.chromium.org/339009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui_test_utils.cc')
-rw-r--r-- | chrome/test/ui_test_utils.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index c9348b3..59663b2 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -503,4 +503,27 @@ void RegisterAndWait(NotificationType::Type type, 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 |