Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/start-time-grouping.html

Issue 1374193002: Web Animations: Don't participate in grouping when start time is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CompositorPendingAnimations.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/web-animations-api/start-time-grouping.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/start-time-grouping.html b/third_party/WebKit/LayoutTests/web-animations-api/start-time-grouping.html
new file mode 100644
index 0000000000000000000000000000000000000000..7157ec4e64297865c00893e745cdcf3cf458d1c1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/web-animations-api/start-time-grouping.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+div {
+ width: 50px;
+ height: 50px;
+ background: green;
+}
+</style>
+<div id=target1></div>
+<div id=target2></div>
+<script>
+var anim1, anim2;
+anim1 = target1.animate([
+ {transform: 'none'},
+ {transform: 'translateX(500px)'},
+], 1000);
+
+function awaitFrame(frameTest) {
+ return new Promise(resolve => {
+ requestAnimationFrame(() => {
+ if (frameTest()) {
+ resolve();
+ } else {
+ awaitFrame(frameTest).then(resolve);
+ }
+ });
+ });
+}
+
+awaitFrame(() => anim1.currentTime > 100).then(() => {
+ requestAnimationFrame(t => {
+ // Testing a regression where scheduling anim1 and anim2 together caused anim2
+ // to get anim1's start time.
+ anim1.startTime = t - 100;
+ anim2 = target2.animate([
+ {transform: 'none'},
+ {transform: 'translateX(500px)'},
+ ], 200);
+ });
+});
+
+async_test(t => {
+ awaitFrame(() => anim2 && anim2.startTime != null).then(() => {
+ t.step(() => assert_not_equals(Math.round(anim1.startTime), Math.round(anim2.startTime)));
+ t.done();
+ });
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CompositorPendingAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698