OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/Timer.h" | 5 #include "platform/Timer.h" |
6 | 6 |
7 #include "platform/testing/TestingPlatformSupport.h" | 7 #include "platform/testing/TestingPlatformSupport.h" |
8 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
9 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
10 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
11 #include "public/platform/WebViewScheduler.h" | 11 #include "public/platform/WebViewScheduler.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "wtf/RefCounted.h" |
14 #include <queue> | 15 #include <queue> |
15 | 16 |
16 using testing::ElementsAre; | 17 using testing::ElementsAre; |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
19 namespace { | 20 namespace { |
20 double gCurrentTimeSecs = 0.0; | 21 double gCurrentTimeSecs = 0.0; |
21 | 22 |
22 // This class exists because gcc doesn't know how to move an OwnPtr. | 23 // This class exists because gcc doesn't know how to move an OwnPtr. |
23 class RefCountedTaskContainer : public RefCounted<RefCountedTaskContainer> { | 24 class RefCountedTaskContainer : public RefCounted<RefCountedTaskContainer> { |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); | 761 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); |
761 timer.startOneShot(0, BLINK_FROM_HERE); | 762 timer.startOneShot(0, BLINK_FROM_HERE); |
762 | 763 |
763 // Make sure the task was posted on taskRunner. | 764 // Make sure the task was posted on taskRunner. |
764 EXPECT_FALSE(timerTasks.empty()); | 765 EXPECT_FALSE(timerTasks.empty()); |
765 } | 766 } |
766 | 767 |
767 | 768 |
768 } // namespace | 769 } // namespace |
769 } // namespace blink | 770 } // namespace blink |
OLD | NEW |