OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/timer.h" | 7 #include "base/timer.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 using base::TimeDelta; | 10 using base::TimeDelta; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_IO); | 313 RunTest_DelayTimer_NoCall(MessageLoop::TYPE_IO); |
314 } | 314 } |
315 | 315 |
316 TEST(TimerTest, DelayTimer_OneCall) { | 316 TEST(TimerTest, DelayTimer_OneCall) { |
317 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_DEFAULT); | 317 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_DEFAULT); |
318 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_UI); | 318 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_UI); |
319 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_IO); | 319 RunTest_DelayTimer_OneCall(MessageLoop::TYPE_IO); |
320 } | 320 } |
321 | 321 |
322 // It's flaky on the buildbot, http://crbug.com/25038. | 322 // It's flaky on the buildbot, http://crbug.com/25038. |
323 TEST(TimerTest, FLAKY_DelayTimer_Reset) { | 323 TEST(TimerTest, DISABLED_DelayTimer_Reset) { |
324 RunTest_DelayTimer_Reset(MessageLoop::TYPE_DEFAULT); | 324 RunTest_DelayTimer_Reset(MessageLoop::TYPE_DEFAULT); |
325 RunTest_DelayTimer_Reset(MessageLoop::TYPE_UI); | 325 RunTest_DelayTimer_Reset(MessageLoop::TYPE_UI); |
326 RunTest_DelayTimer_Reset(MessageLoop::TYPE_IO); | 326 RunTest_DelayTimer_Reset(MessageLoop::TYPE_IO); |
327 } | 327 } |
328 | 328 |
329 TEST(TimerTest, DelayTimer_Deleted) { | 329 TEST(TimerTest, DelayTimer_Deleted) { |
330 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_DEFAULT); | 330 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_DEFAULT); |
331 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_UI); | 331 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_UI); |
332 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_IO); | 332 RunTest_DelayTimer_Deleted(MessageLoop::TYPE_IO); |
333 } | 333 } |
(...skipping 11 matching lines...) Expand all Loading... |
345 OneShotTimerTester d(&did_run); | 345 OneShotTimerTester d(&did_run); |
346 { | 346 { |
347 MessageLoop loop(MessageLoop::TYPE_DEFAULT); | 347 MessageLoop loop(MessageLoop::TYPE_DEFAULT); |
348 a.Start(); | 348 a.Start(); |
349 b.Start(); | 349 b.Start(); |
350 } // MessageLoop destructs by falling out of scope. | 350 } // MessageLoop destructs by falling out of scope. |
351 } // OneShotTimers destruct. SHOULD NOT CRASH, of course. | 351 } // OneShotTimers destruct. SHOULD NOT CRASH, of course. |
352 | 352 |
353 EXPECT_FALSE(did_run); | 353 EXPECT_FALSE(did_run); |
354 } | 354 } |
OLD | NEW |