| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
| 7 #include "base/task.h" | 7 #include "base/task.h" |
| 8 #include "base/timer.h" | 8 #include "base/timer.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_UI); | 311 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_UI); |
| 312 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_IO); | 312 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_IO); |
| 313 } | 313 } |
| 314 | 314 |
| 315 TEST(TimerTest, DelayTimer_OneCall) { | 315 TEST(TimerTest, DelayTimer_OneCall) { |
| 316 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_DEFAULT); | 316 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_DEFAULT); |
| 317 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_UI); | 317 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_UI); |
| 318 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_IO); | 318 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_IO); |
| 319 } | 319 } |
| 320 | 320 |
| 321 TEST(TimerTest, DelayTimer_Reset) { | 321 // Disabled because it's flaky on the buildbot. Bug not filed because this |
| 322 // kind of test is difficult to make not-flaky on buildbots. |
| 323 TEST(TimerTest, DISABLED_DelayTimer_Reset) { |
| 322 RunTest_DelayTimer_Reset(MessageLoop::TYPE_DEFAULT); | 324 RunTest_DelayTimer_Reset(MessageLoop::TYPE_DEFAULT); |
| 323 RunTest_DelayTimer_Reset(MessageLoop::TYPE_UI); | 325 RunTest_DelayTimer_Reset(MessageLoop::TYPE_UI); |
| 324 RunTest_DelayTimer_Reset(MessageLoop::TYPE_IO); | 326 RunTest_DelayTimer_Reset(MessageLoop::TYPE_IO); |
| 325 } | 327 } |
| 326 | 328 |
| 327 TEST(TimerTest, DelayTimer_Deleted) { | 329 TEST(TimerTest, DelayTimer_Deleted) { |
| 328 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_DEFAULT); | 330 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_DEFAULT); |
| 329 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_UI); | 331 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_UI); |
| 330 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_IO); | 332 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_IO); |
| 331 } | 333 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 343 OneShotTimerTester d(&did_run); | 345 OneShotTimerTester d(&did_run); |
| 344 { | 346 { |
| 345 MessageLoop loop(MessageLoop::TYPE_DEFAULT); | 347 MessageLoop loop(MessageLoop::TYPE_DEFAULT); |
| 346 a.Start(); | 348 a.Start(); |
| 347 b.Start(); | 349 b.Start(); |
| 348 } // MessageLoop destructs by falling out of scope. | 350 } // MessageLoop destructs by falling out of scope. |
| 349 } // OneShotTimers destruct. SHOULD NOT CRASH, of course. | 351 } // OneShotTimers destruct. SHOULD NOT CRASH, of course. |
| 350 | 352 |
| 351 EXPECT_EQ(false, did_run); | 353 EXPECT_EQ(false, did_run); |
| 352 } | 354 } |
| OLD | NEW |