Bug 1397127 - Rewrite a test with async/await. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 06 Sep 2017 13:51:18 +0900
changeset 659674 0b175a62eb3292cf21a05f174cade98a75886c22
parent 659384 f64e2b4dcf5eec0b4ad456c149680a67b7c26dc4
child 730014 38c0f3ab567447c10e58cec1a9e2fa27ea5bd6c6
push id78155
push userhikezoe@mozilla.com
push dateWed, 06 Sep 2017 04:51:43 +0000
reviewersbirtles
bugs1397127
milestone57.0a1
Bug 1397127 - Rewrite a test with async/await. r?birtles MozReview-Commit-ID: Jdh4G022Gzd
dom/animation/test/chrome/test_restyles.html
--- a/dom/animation/test/chrome/test_restyles.html
+++ b/dom/animation/test/chrome/test_restyles.html
@@ -1003,34 +1003,34 @@ waitForAllPaints(function() {
     is(markers.length, 0,
        'CSS animation on an out-of-view element with pre-transform should be ' +
        'throttled.');
 
     await ensureElementRemoval(scrollDiv);
   });
 
   add_task_if_omta_enabled(
-    function* no_restyling_for_compositor_animation_on_unrelated_style_change() {
+    async function no_restyling_for_compositor_animation_on_unrelated_style_change() {
       var div = addDiv(null);
       var animation = div.animate({ opacity: [0, 1] }, 100 * MS_PER_SEC);
 
-      yield animation.ready;
+      await animation.ready;
       ok(animation.isRunningOnCompositor,
          'The opacity animation is running on the compositor');
 
       div.style.setProperty('color', 'blue', '');
-      var markers = yield observeStyling(5);
+      var markers = await observeStyling(5);
       if (isServo) {
         is(markers.length, 0,
            'The opacity animation keeps running on the compositor when ' +
            'color style is changed');
       } else {
         todo_is(markers.length, 0,
                 'Bug 1307341 The opacity animation keeps running on the ' +
                 'compositor when color style is changed');
       }
-      yield ensureElementRemoval(div);
+      await ensureElementRemoval(div);
     }
   );
 });
 
 </script>
 </body>