diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
commit | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch) | |
tree | 8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit/chromium/tests/CCSchedulerTest.cpp | |
parent | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff) | |
download | qtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz |
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit/chromium/tests/CCSchedulerTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/CCSchedulerTest.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/WebKit/chromium/tests/CCSchedulerTest.cpp b/Source/WebKit/chromium/tests/CCSchedulerTest.cpp index 0fe811d86..475987f13 100644 --- a/Source/WebKit/chromium/tests/CCSchedulerTest.cpp +++ b/Source/WebKit/chromium/tests/CCSchedulerTest.cpp @@ -77,6 +77,7 @@ TEST(CCSchedulerTest, RequestCommit) scheduler->setNeedsCommit(); EXPECT_EQ(1, client.numActions()); EXPECT_STREQ("scheduledActionBeginFrame", client.action(0)); + EXPECT_FALSE(timeSource->active()); client.reset(); // Since, hasMoreResourceUpdates is set to false, @@ -86,17 +87,18 @@ TEST(CCSchedulerTest, RequestCommit) EXPECT_EQ(2, client.numActions()); EXPECT_STREQ("scheduledActionUpdateMoreResources", client.action(0)); EXPECT_STREQ("scheduledActionCommit", client.action(1)); + EXPECT_TRUE(timeSource->active()); client.reset(); // Tick should draw. timeSource->tick(); EXPECT_EQ(1, client.numActions()); EXPECT_STREQ("scheduledActionDrawAndSwap", client.action(0)); + EXPECT_FALSE(timeSource->active()); client.reset(); - // Tick should do nothing. - timeSource->tick(); - EXPECT_EQ(0, client.numActions()); + // Timer should be off. + EXPECT_FALSE(timeSource->active()); } TEST(CCSchedulerTest, RequestCommitAfterBeginFrame) @@ -126,6 +128,7 @@ TEST(CCSchedulerTest, RequestCommitAfterBeginFrame) // Tick should draw but then begin another frame. timeSource->tick(); + EXPECT_FALSE(timeSource->active()); EXPECT_EQ(2, client.numActions()); EXPECT_STREQ("scheduledActionDrawAndSwap", client.action(0)); EXPECT_STREQ("scheduledActionBeginFrame", client.action(1)); @@ -175,15 +178,18 @@ TEST(CCSchedulerTest, RequestRedrawInsideDraw) scheduler->setNeedsRedraw(); EXPECT_TRUE(scheduler->redrawPending()); + EXPECT_TRUE(timeSource->active()); EXPECT_EQ(0, client.numDraws()); timeSource->tick(); EXPECT_EQ(1, client.numDraws()); EXPECT_TRUE(scheduler->redrawPending()); + EXPECT_TRUE(timeSource->active()); timeSource->tick(); EXPECT_EQ(2, client.numDraws()); EXPECT_FALSE(scheduler->redrawPending()); + EXPECT_FALSE(timeSource->active()); } class SchedulerClientThatSetNeedsCommitInsideDraw : public CCSchedulerClient { @@ -228,14 +234,17 @@ TEST(CCSchedulerTest, RequestCommitInsideDraw) scheduler->setNeedsRedraw(); EXPECT_TRUE(scheduler->redrawPending()); EXPECT_EQ(0, client.numDraws()); + EXPECT_TRUE(timeSource->active()); timeSource->tick(); + EXPECT_FALSE(timeSource->active()); EXPECT_EQ(1, client.numDraws()); EXPECT_TRUE(scheduler->commitPending()); scheduler->beginFrameComplete(); timeSource->tick(); EXPECT_EQ(2, client.numDraws()); + EXPECT_FALSE(timeSource->active()); EXPECT_FALSE(scheduler->redrawPending()); } |