summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/CCSchedulerTestCommon.h')
-rw-r--r--Source/WebKit/chromium/tests/CCSchedulerTestCommon.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
index 9b5e0383e..6257ec888 100644
--- a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
+++ b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
@@ -26,6 +26,7 @@
#define CCSchedulerTestCommon_h
#include "cc/CCDelayBasedTimeSource.h"
+#include "cc/CCFrameRateController.h"
#include "cc/CCThread.h"
#include <gtest/gtest.h>
#include <wtf/OwnPtr.h>
@@ -38,7 +39,7 @@ public:
void reset() { m_tickCalled = false; }
bool tickCalled() const { return m_tickCalled; }
- virtual void onTimerTick() { m_tickCalled = true; }
+ virtual void onTimerTick() OVERRIDE { m_tickCalled = true; }
protected:
bool m_tickCalled;
@@ -61,7 +62,7 @@ public:
task->performTask();
}
- long long pendingDelay() const
+ long long pendingDelayMs() const
{
EXPECT_TRUE(hasPendingTask());
return m_pendingTaskDelay;
@@ -89,9 +90,9 @@ public:
virtual ~FakeCCTimeSource() { }
- virtual void setClient(WebCore::CCTimeSourceClient* client) { m_client = client; }
- virtual void setActive(bool b) { m_active = b; }
- virtual bool active() const { return m_active; }
+ virtual void setClient(WebCore::CCTimeSourceClient* client) OVERRIDE { m_client = client; }
+ virtual void setActive(bool b) OVERRIDE { m_active = b; }
+ virtual bool active() const OVERRIDE { return m_active; }
void tick()
{
@@ -107,20 +108,27 @@ protected:
class FakeCCDelayBasedTimeSource : public WebCore::CCDelayBasedTimeSource {
public:
- static PassRefPtr<FakeCCDelayBasedTimeSource> create(double intervalMs, WebCore::CCThread* thread)
+ static PassRefPtr<FakeCCDelayBasedTimeSource> create(double interval, WebCore::CCThread* thread)
{
- return adoptRef(new FakeCCDelayBasedTimeSource(intervalMs, thread));
+ return adoptRef(new FakeCCDelayBasedTimeSource(interval, thread));
}
- void setMonotonicallyIncreasingTimeMs(double time) { m_monotonicallyIncreasingTimeMs = time; }
- virtual double monotonicallyIncreasingTimeMs() const { return m_monotonicallyIncreasingTimeMs; }
+ void setMonotonicallyIncreasingTime(double time) { m_monotonicallyIncreasingTime = time; }
+ virtual double monotonicallyIncreasingTime() const { return m_monotonicallyIncreasingTime; }
protected:
- FakeCCDelayBasedTimeSource(double intervalMs, WebCore::CCThread* thread)
- : CCDelayBasedTimeSource(intervalMs, thread)
- , m_monotonicallyIncreasingTimeMs(0) { }
+ FakeCCDelayBasedTimeSource(double interval, WebCore::CCThread* thread)
+ : CCDelayBasedTimeSource(interval, thread)
+ , m_monotonicallyIncreasingTime(0) { }
- double m_monotonicallyIncreasingTimeMs;
+ double m_monotonicallyIncreasingTime;
+};
+
+class FakeCCFrameRateController : public WebCore::CCFrameRateController {
+public:
+ FakeCCFrameRateController(PassRefPtr<WebCore::CCTimeSource> timer) : WebCore::CCFrameRateController(timer) { }
+
+ int numFramesPending() const { return m_numFramesPending; }
};
}