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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html

Issue 2697453005: Import wpt@758b3b4cfa805067f36121333ba031e583d3a62c (Closed)
Patch Set: Add -expected.txt files. Created 3 years, 10 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
Index: third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html
index d56de1b0313b4c7148c0f9c547ff507ece881f90..006b54a0af3528410898dcddd62c957b05b0b3bf 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html
@@ -366,5 +366,55 @@ promise_test(function(t) {
'falls out finished state even though the current finished ' +
'promise is generated soon after animation state became finished');
+promise_test(function(t) {
+ var animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
+ var ready = false;
+ animation.ready.then(
+ t.step_func(function() {
+ ready = true;
+ }),
+ t.unreached_func('Ready promise must not be rejected')
+ );
+
+ var testSuccess = animation.finished.then(
+ t.step_func(function() {
+ assert_true(ready, 'Ready promise has resolved');
+ }),
+ t.unreached_func('Finished promise must not be rejected')
+ );
+
+ var timeout = waitForAnimationFrames(3).then(function() {
+ return Promise.reject('Finished promise did not arrive in time');
+ });
+
+ animation.finish();
+ return Promise.race([timeout, testSuccess]);
+}, 'Finished promise should be resolved after the ready promise is resolved');
+
+promise_test(function(t) {
+ var animation = createDiv(t).animate(null, 100 * MS_PER_SEC);
+ var caught = false;
+ animation.ready.then(
+ t.unreached_func('Ready promise must not be resolved'),
+ t.step_func(function() {
+ caught = true;
+ })
+ );
+
+ var testSuccess = animation.finished.then(
+ t.unreached_func('Finished promise must not be resolved'),
+ t.step_func(function() {
+ assert_true(caught, 'Ready promise has been rejected');
+ })
+ );
+
+ var timeout = waitForAnimationFrames(3).then(function() {
+ return Promise.reject('Finished promise was not rejected in time');
+ });
+
+ animation.cancel();
+ return Promise.race([timeout, testSuccess]);
+}, 'Finished promise should be rejected after the ready promise is rejected');
+
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698