From cd44dc59cdfc39534aef4d417e9f3c412e3be139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Feb 2012 09:55:33 +0100 Subject: Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560) --- Source/WebKit/chromium/tests/CCSchedulerTest.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Source/WebKit/chromium/tests/CCSchedulerTest.cpp') 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()); } -- cgit v1.2.1