diff options
author | dstockwell <dstockwell@chromium.org> | 2015-11-03 18:50:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-04 02:51:10 +0000 |
commit | 1bdb2cb318172358647853128a3d3db3f1c7c97a (patch) | |
tree | 4c367b20b4e3e3a927497adcd53acfde5e463237 /third_party/WebKit/LayoutTests/web-animations-api | |
parent | 48ad0811858074ef9cc7456dfcc3b53f821a75c2 (diff) | |
download | chromium_src-1bdb2cb318172358647853128a3d3db3f1c7c97a.zip chromium_src-1bdb2cb318172358647853128a3d3db3f1c7c97a.tar.gz chromium_src-1bdb2cb318172358647853128a3d3db3f1c7c97a.tar.bz2 |
Web Animations: Use a single animation clock
All animation clocks for a page should tick at the same time, but since we
had an animation clock per document there were some cases where clocks
could tick independently.
This patch moves the clock from Document to PageAnimator.
animation-timeline-detached-no-crash.html is removed as the test was not valid
due to the animation's document not being active.
Review URL: https://codereview.chromium.org/1410313004
Cr-Commit-Position: refs/heads/master@{#357736}
Diffstat (limited to 'third_party/WebKit/LayoutTests/web-animations-api')
2 files changed, 23 insertions, 14 deletions
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/animation-timeline-detached-no-crash.html b/third_party/WebKit/LayoutTests/web-animations-api/animation-timeline-detached-no-crash.html deleted file mode 100644 index 46e569e..0000000 --- a/third_party/WebKit/LayoutTests/web-animations-api/animation-timeline-detached-no-crash.html +++ /dev/null @@ -1,14 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> - -<script> -test(function() { - var doc = document.implementation.createDocument("", "", null); - doc.createElement("div").animate([], 1000); - var anim = doc.timeline.getAnimations()[0]; - doc = null; - gc(); - anim.cancel(); -}, 'Calling cancel() on an animation detached from its timeline should not crash.'); -</script> diff --git a/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html b/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html new file mode 100644 index 0000000..f72f665 --- /dev/null +++ b/third_party/WebKit/LayoutTests/web-animations-api/time-consistent-across-frames.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> + +<iframe id=frame></iframe> + +<script> +var handle = async_test('Animation time should tick consistently across frames'); +var baseTime = document.timeline.currentTime; +var frameBaseTime = frame.contentDocument.timeline.currentTime; +setTimeout(function() { + var start = performance.now(); + while (performance.now() - start < 30); + var delta = document.timeline.currentTime - baseTime; + + var start = performance.now(); + while (performance.now() - start < 30); + var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; + + handle.step(() => assert_equals(Math.round(delta), Math.round(frameDelta))); + handle.done(); +}); +</script> |