summaryrefslogtreecommitdiffstats
path: root/base/message_pump_glib_unittest.cc
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 16:44:53 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-04 16:44:53 +0000
commit5761ab9c0748737773196f3ed02616ae6c6a1b59 (patch)
tree33a2d59a92143e36fb9790822a76e6468b885f19 /base/message_pump_glib_unittest.cc
parentd8f868a635906d720e5a717e5a81f36df211b719 (diff)
downloadchromium_src-5761ab9c0748737773196f3ed02616ae6c6a1b59.zip
chromium_src-5761ab9c0748737773196f3ed02616ae6c6a1b59.tar.gz
chromium_src-5761ab9c0748737773196f3ed02616ae6c6a1b59.tar.bz2
Fix calls in base and net unit tests to use TimeDelta.
I found another batch of unit tests that needed their Sleep() and PostDelayedTask() interfaces updated. As far as I know, this is the last batch of changes required before the deprecated integer interfaces to these functions can be removed. R=jar@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9316036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_glib_unittest.cc')
-rw-r--r--base/message_pump_glib_unittest.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/base/message_pump_glib_unittest.cc b/base/message_pump_glib_unittest.cc
index c709355..550c0e7 100644
--- a/base/message_pump_glib_unittest.cc
+++ b/base/message_pump_glib_unittest.cc
@@ -252,7 +252,9 @@ TEST_F(MessagePumpGLibTest, TestWorkWhileWaitingForEvents) {
task_count = 0;
for (int i = 0; i < 10; ++i) {
loop()->PostDelayedTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count), 10*i);
+ FROM_HERE,
+ base::Bind(&IncrementInt, &task_count),
+ base::TimeDelta::FromMilliseconds(10*i));
}
// After all the previous tasks have executed, enqueue an event that will
// quit.
@@ -261,7 +263,8 @@ TEST_F(MessagePumpGLibTest, TestWorkWhileWaitingForEvents) {
loop()->PostDelayedTask(
FROM_HERE,
base::Bind(&EventInjector::AddEvent, base::Unretained(injector()), 10,
- MessageLoop::QuitClosure()), 150);
+ MessageLoop::QuitClosure()),
+ base::TimeDelta::FromMilliseconds(150));
loop()->Run();
ASSERT_EQ(10, task_count);
EXPECT_EQ(1, injector()->processed_events());
@@ -497,9 +500,13 @@ void TestGLibLoopInternal(EventInjector* injector) {
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count), 30);
+ FROM_HERE,
+ base::Bind(&IncrementInt, &task_count),
+ base::TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&GLibLoopRunner::Quit, runner.get()), 40);
+ FROM_HERE,
+ base::Bind(&GLibLoopRunner::Quit, runner.get()),
+ base::TimeDelta::FromMilliseconds(40));
// Run a nested, straight GLib message loop.
runner->RunGLib();
@@ -528,9 +535,13 @@ void TestGtkLoopInternal(EventInjector* injector) {
injector->AddDummyEvent(10);
// Delayed work
MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&IncrementInt, &task_count), 30);
+ FROM_HERE,
+ base::Bind(&IncrementInt, &task_count),
+ base::TimeDelta::FromMilliseconds(30));
MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&GLibLoopRunner::Quit, runner.get()), 40);
+ FROM_HERE,
+ base::Bind(&GLibLoopRunner::Quit, runner.get()),
+ base::TimeDelta::FromMilliseconds(40));
// Run a nested, straight Gtk message loop.
runner->RunLoop();