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

Unified Diff: third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html

Issue 2145263002: Rewrite test in terms of promise rejection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html
diff --git a/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html b/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html
index c85dc9c013ed2e3e2bf8083546d207576228d938..afd891fc575a6be9b0b7cba51fa9b238bf763364 100644
--- a/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html
+++ b/third_party/WebKit/LayoutTests/web-animations-api/animation-finish-event-cancelled.html
@@ -6,28 +6,21 @@
<script src="../resources/testharnessreport.js"></script>
<body>
<script>
-var anim1 = document.body.animate([], 100000);
-var anim2 = document.body.animate([], 100000);
-var anim3 = document.body.animate([], 100000);
+async_test(t => {
+ var anim1 = document.body.animate([], 100000);
+ var anim2 = document.body.animate([], 100000);
-var noFinish = async_test('Animation finish event should not fire when cancelled');
-
-anim1.onfinish = function() {
- noFinish.step(function() {
- anim3.finish();
+ var success = false;
+ anim2.finished.catch(function() {
+ success = true;
});
-};
-anim2.onfinish = function() {
- noFinish.step(function() {
- assert_true(false);
+ anim1.finished.then(function() {
+ assert_true(success, 'anim2 finished promise should be rejected on cancelation');
+ t.done();
});
-};
-
-anim3.onfinish = function() {
- noFinish.done();
-};
-anim1.finish();
-anim2.cancel();
+ anim2.cancel();
+ anim1.finish();
+}, 'Animation finished promise should be rejected when animation canceled');
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698