Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: cc/test/scheduler_test_common.h

Issue 12408028: cc: Delay start of scrollbar animation setNeedsRedraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to 188682 Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test_common.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_
6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time.h"
9 #include "cc/base/thread.h" 10 #include "cc/base/thread.h"
10 #include "cc/delay_based_time_source.h" 11 #include "cc/delay_based_time_source.h"
11 #include "cc/frame_rate_controller.h" 12 #include "cc/frame_rate_controller.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace cc { 15 namespace cc {
15 16
16 class FakeTimeSourceClient : public cc::TimeSourceClient { 17 class FakeTimeSourceClient : public cc::TimeSourceClient {
17 public: 18 public:
18 FakeTimeSourceClient() { reset(); } 19 FakeTimeSourceClient() { reset(); }
(...skipping 26 matching lines...) Expand all
45 bool hasPendingTask() const { return m_pendingTask; } 46 bool hasPendingTask() const { return m_pendingTask; }
46 void runPendingTask(); 47 void runPendingTask();
47 48
48 long long pendingDelayMs() const 49 long long pendingDelayMs() const
49 { 50 {
50 EXPECT_TRUE(hasPendingTask()); 51 EXPECT_TRUE(hasPendingTask());
51 return m_pendingTaskDelay; 52 return m_pendingTaskDelay;
52 } 53 }
53 54
54 virtual void PostTask(base::Closure cb) OVERRIDE; 55 virtual void PostTask(base::Closure cb) OVERRIDE;
55 virtual void PostDelayedTask(base::Closure cb, long long delay_ms) OVERRIDE; 56 virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay)
57 OVERRIDE;
56 virtual bool BelongsToCurrentThread() const OVERRIDE; 58 virtual bool BelongsToCurrentThread() const OVERRIDE;
57 59
58 protected: 60 protected:
59 scoped_ptr<base::Closure> m_pendingTask; 61 scoped_ptr<base::Closure> m_pendingTask;
60 long long m_pendingTaskDelay; 62 long long m_pendingTaskDelay;
61 bool m_runPendingTaskOnOverwrite; 63 bool m_runPendingTaskOnOverwrite;
62 }; 64 };
63 65
64 class FakeTimeSource : public cc::TimeSource { 66 class FakeTimeSource : public cc::TimeSource {
65 public: 67 public:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 class FakeFrameRateController : public cc::FrameRateController { 118 class FakeFrameRateController : public cc::FrameRateController {
117 public: 119 public:
118 FakeFrameRateController(scoped_refptr<cc::TimeSource> timer) : cc::FrameRate Controller(timer) { } 120 FakeFrameRateController(scoped_refptr<cc::TimeSource> timer) : cc::FrameRate Controller(timer) { }
119 121
120 int numFramesPending() const { return m_numFramesPending; } 122 int numFramesPending() const { return m_numFramesPending; }
121 }; 123 };
122 124
123 } // namespace cc 125 } // namespace cc
124 126
125 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 127 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test_common.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698