OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/frame_rate_controller.h" | 5 #include "cc/frame_rate_controller.h" |
6 | 6 |
7 #include "cc/test/scheduler_test_common.h" | 7 #include "cc/test/scheduler_test_common.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 using namespace WebKitTests; | |
11 | |
12 namespace cc { | 10 namespace cc { |
13 namespace { | 11 namespace { |
14 | 12 |
15 class FakeFrameRateControllerClient : public cc::FrameRateControllerClient { | 13 class FakeFrameRateControllerClient : public cc::FrameRateControllerClient { |
16 public: | 14 public: |
17 FakeFrameRateControllerClient() { reset(); } | 15 FakeFrameRateControllerClient() { reset(); } |
18 | 16 |
19 void reset() { m_vsyncTicked = false; } | 17 void reset() { m_vsyncTicked = false; } |
20 bool vsyncTicked() const { return m_vsyncTicked; } | 18 bool vsyncTicked() const { return m_vsyncTicked; } |
21 | 19 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 EXPECT_FALSE(thread.hasPendingTask()); | 158 EXPECT_FALSE(thread.hasPendingTask()); |
161 | 159 |
162 // didFinishFrame triggers a frame, make sure the vsync callback is called | 160 // didFinishFrame triggers a frame, make sure the vsync callback is called |
163 controller.didFinishFrame(); | 161 controller.didFinishFrame(); |
164 thread.runPendingTask(); | 162 thread.runPendingTask(); |
165 EXPECT_TRUE(client.vsyncTicked()); | 163 EXPECT_TRUE(client.vsyncTicked()); |
166 } | 164 } |
167 | 165 |
168 } // namespace | 166 } // namespace |
169 } // namespace cc | 167 } // namespace cc |
OLD | NEW |