diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
tree | f6256640b6c46d7da221435803cae65326817ba2 /Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp | |
parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp index 08b5d8202..1197a3118 100644 --- a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp +++ b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp @@ -24,10 +24,10 @@ #include "config.h" -#include "cc/CCDelayBasedTimeSource.h" +#include "CCDelayBasedTimeSource.h" #include "CCSchedulerTestCommon.h" -#include "cc/CCThread.h" +#include "CCThread.h" #include <gtest/gtest.h> #include <wtf/RefPtr.h> @@ -44,12 +44,12 @@ TEST(CCDelayBasedTimeSourceTest, TaskPostedAndTickCalled) RefPtr<FakeCCDelayBasedTimeSource> timer = FakeCCDelayBasedTimeSource::create(1.0 / 60.0, &thread); timer->setClient(&client); - timer->setMonotonicallyIncreasingTime(0); + timer->setMonotonicTimeNow(0); timer->setActive(true); EXPECT_TRUE(timer->active()); EXPECT_TRUE(thread.hasPendingTask()); - timer->setMonotonicallyIncreasingTime(0.016); + timer->setMonotonicTimeNow(0.016); thread.runPendingTask(); EXPECT_TRUE(timer->active()); EXPECT_TRUE(client.tickCalled()); @@ -109,7 +109,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenExactlyOnRequestedTime) EXPECT_EQ(16, thread.pendingDelayMs()); - timer->setMonotonicallyIncreasingTime(interval); + timer->setMonotonicTimeNow(interval); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -130,7 +130,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenSlightlyAfterRequestedTime) EXPECT_EQ(16, thread.pendingDelayMs()); - timer->setMonotonicallyIncreasingTime(interval + 0.0000001); + timer->setMonotonicTimeNow(interval + 0.0000001); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -151,7 +151,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenExactlyTwiceAfterRequestedTime) EXPECT_EQ(16, thread.pendingDelayMs()); - timer->setMonotonicallyIncreasingTime(2*interval); + timer->setMonotonicTimeNow(2*interval); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -172,7 +172,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenSlightlyAfterTwiceRequestedTime) EXPECT_EQ(16, thread.pendingDelayMs()); - timer->setMonotonicallyIncreasingTime(2*interval + 0.0000001); + timer->setMonotonicTimeNow(2*interval + 0.0000001); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -193,7 +193,7 @@ TEST(CCDelayBasedTimeSource, NextDelaySaneWhenHalfAfterRequestedTime) EXPECT_EQ(16, thread.pendingDelayMs()); - timer->setMonotonicallyIncreasingTime(interval + interval * 0.5); + timer->setMonotonicTimeNow(interval + interval * 0.5); thread.runPendingTask(); EXPECT_EQ(8, thread.pendingDelayMs()); @@ -216,7 +216,7 @@ TEST(CCDelayBasedTimeSource, SaneHandlingOfJitteryTimebase) // Jitter timebase ~1ms late timer->setTimebaseAndInterval(interval + 0.001, interval); - timer->setMonotonicallyIncreasingTime(interval); + timer->setMonotonicTimeNow(interval); thread.runPendingTask(); // Without double tick prevention, pendingDelayMs would be 1. @@ -224,7 +224,7 @@ TEST(CCDelayBasedTimeSource, SaneHandlingOfJitteryTimebase) // Jitter timebase ~1ms early timer->setTimebaseAndInterval(interval * 2 - 0.001, interval); - timer->setMonotonicallyIncreasingTime(interval * 2); + timer->setMonotonicTimeNow(interval * 2); thread.runPendingTask(); EXPECT_EQ(15, thread.pendingDelayMs()); @@ -244,7 +244,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantTimebaseChangesImmediately) EXPECT_EQ(16, thread.pendingDelayMs()); // Tick, then shift timebase by +7ms. - timer->setMonotonicallyIncreasingTime(interval); + timer->setMonotonicTimeNow(interval); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -258,7 +258,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantTimebaseChangesImmediately) EXPECT_EQ(7, thread.pendingDelayMs()); // Tick, then shift timebase by -7ms. - timer->setMonotonicallyIncreasingTime(interval + 0.0070001); + timer->setMonotonicTimeNow(interval + 0.0070001); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -286,7 +286,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantIntervalChangesImmediately) EXPECT_EQ(16, thread.pendingDelayMs()); // Tick, then double the interval. - timer->setMonotonicallyIncreasingTime(interval); + timer->setMonotonicTimeNow(interval); thread.runPendingTask(); EXPECT_EQ(16, thread.pendingDelayMs()); @@ -300,7 +300,7 @@ TEST(CCDelayBasedTimeSource, HanldlesSignificantIntervalChangesImmediately) EXPECT_EQ(33, thread.pendingDelayMs()); // Tick, then halve the interval. - timer->setMonotonicallyIncreasingTime(interval * 3); + timer->setMonotonicTimeNow(interval * 3); thread.runPendingTask(); EXPECT_EQ(33, thread.pendingDelayMs()); @@ -332,8 +332,8 @@ TEST(CCDelayBasedTimeSourceTest, AchievesTargetRateWithNoNoise) totalFrameTime += delayMs / 1000.0; // Run the callback exactly when asked - double now = timer->monotonicallyIncreasingTime() + delayMs / 1000.0; - timer->setMonotonicallyIncreasingTime(now); + double now = timer->monotonicTimeNow() + delayMs / 1000.0; + timer->setMonotonicTimeNow(now); thread.runPendingTask(); } double averageInterval = totalFrameTime / static_cast<double>(numIterations); @@ -361,7 +361,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateBeforeNextTickTime) // Should run the activate task, and pick up a new timebase. timer->setActive(true); - timer->setMonotonicallyIncreasingTime(0); + timer->setMonotonicTimeNow(0); thread.runPendingTask(); // Stop the timer @@ -372,7 +372,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateBeforeNextTickTime) // Start the timer again, but before the next tick time the timer previously // planned on using. That same tick time should still be targeted. - timer->setMonotonicallyIncreasingTime(0.004); + timer->setMonotonicTimeNow(0.004); timer->setActive(true); EXPECT_EQ(12, thread.pendingDelayMs()); } @@ -386,7 +386,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateAfterNextTickTime) // Should run the activate task, and pick up a new timebase. timer->setActive(true); - timer->setMonotonicallyIncreasingTime(0); + timer->setMonotonicTimeNow(0); thread.runPendingTask(); // Stop the timer @@ -397,7 +397,7 @@ TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateAfterNextTickTime) // Start the timer again, but before the next tick time the timer previously // planned on using. That same tick time should still be targeted. - timer->setMonotonicallyIncreasingTime(0.02); + timer->setMonotonicTimeNow(0.02); timer->setActive(true); EXPECT_EQ(13, thread.pendingDelayMs()); } |