Web Animations: Fix error in clock update logic and re-enable timeline-time test

BUG=367903

Review URL: https://codereview.chromium.org/279493003

git-svn-id: svn://svn.chromium.org/blink/trunk@173609 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 029de6ba
...@@ -1155,8 +1155,6 @@ crbug.com/367814 [ Win Debug ] fast/dom/custom/document-register-reentrant-throw ...@@ -1155,8 +1155,6 @@ crbug.com/367814 [ Win Debug ] fast/dom/custom/document-register-reentrant-throw
crbug.com/361729 fast/multicol/pagination-h-horizontal-bt.html [ Pass Failure ] crbug.com/361729 fast/multicol/pagination-h-horizontal-bt.html [ Pass Failure ]
crbug.com/361729 fast/multicol/pagination-h-horizontal-tb.html [ Pass Failure ] crbug.com/361729 fast/multicol/pagination-h-horizontal-tb.html [ Pass Failure ]
crbug.com/367903 web-animations-api/timeline-time.html [ Pass Failure ]
# Started failing with v8 roll in chromium r267851. # Started failing with v8 roll in chromium r267851.
crbug.com/369600 fast/events/onerror-no-constructor.html [ Failure ] crbug.com/369600 fast/events/onerror-no-constructor.html [ Failure ]
......
...@@ -31,7 +31,7 @@ test(function() { ...@@ -31,7 +31,7 @@ test(function() {
requestAnimationFrame(function() { requestAnimationFrame(function() {
rafTest.step(function() { rafTest.step(function() {
assert_greater_than(document.timeline.currentTime, startTime); assert_greater_than_equal(document.timeline.currentTime, startTime);
firstRafTime = document.timeline.currentTime; firstRafTime = document.timeline.currentTime;
}); });
}); });
...@@ -43,25 +43,4 @@ test(function() { ...@@ -43,25 +43,4 @@ test(function() {
rafTest.done(); rafTest.done();
}); });
})(); })();
(function() {
var rafTest = async_test('document.timeline.currentTime time should be consistent with the time value passed to RAF callbacks');
var firstRafTime;
var firstRafDelta;
requestAnimationFrame(function(t) {
rafTest.step(function() {
firstRafTime = document.timeline.currentTime;
firstRafDelta = document.timeline.currentTime - t;
});
requestAnimationFrame(function(t) {
rafTest.step(function() {
assert_greater_than(document.timeline.currentTime, firstRafTime);
assert_equals(document.timeline.currentTime - t, firstRafDelta);
});
rafTest.done();
});
});
})();
</script> </script>
...@@ -64,6 +64,8 @@ double AnimationClock::currentTime() ...@@ -64,6 +64,8 @@ double AnimationClock::currentTime()
ASSERT(newTime >= currentTime); ASSERT(newTime >= currentTime);
ASSERT(newTime <= currentTime + approximateFrameTime); ASSERT(newTime <= currentTime + approximateFrameTime);
updateTime(newTime); updateTime(newTime);
} else {
m_currentTask = s_currentTask;
} }
} }
return m_time; return m_time;
......
...@@ -119,4 +119,17 @@ TEST_F(AnimationAnimationClockTest, UpdateTimeIsMonotonic) ...@@ -119,4 +119,17 @@ TEST_F(AnimationAnimationClockTest, UpdateTimeIsMonotonic)
EXPECT_GE(150, animationClock.currentTime()); EXPECT_GE(150, animationClock.currentTime());
} }
TEST_F(AnimationAnimationClockTest, CurrentTimeUpdatesTask)
{
animationClock.updateTime(100);
EXPECT_EQ(100, animationClock.currentTime());
mockTime = 100;
AnimationClock::notifyTaskStart();
EXPECT_EQ(100, animationClock.currentTime());
mockTime = 150;
EXPECT_EQ(100, animationClock.currentTime());
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment