You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/05/09 10:09:14 UTC

[echarts] branch enhance-visual-regression-test updated: test(visual): fix wrong usage of playbackSpeed

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch enhance-visual-regression-test
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/enhance-visual-regression-test by this push:
     new dee167a  test(visual): fix wrong usage of playbackSpeed
dee167a is described below

commit dee167adec2290794b18acb05c66f8320598c379
Author: pissang <bm...@gmail.com>
AuthorDate: Sun May 9 08:22:29 2021 +0800

    test(visual): fix wrong usage of playbackSpeed
---
 test/runTest/runtime/ActionPlayback.js | 11 ++++-------
 test/runTest/runtime/main.js           |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/test/runTest/runtime/ActionPlayback.js b/test/runTest/runtime/ActionPlayback.js
index 1c4680f..4ee68a5 100644
--- a/test/runTest/runtime/ActionPlayback.js
+++ b/test/runTest/runtime/ActionPlayback.js
@@ -60,11 +60,9 @@ export class ActionPlayback {
         this._isLastOpMousewheel = ctx.isLastOpMouseWheel;
     }
 
-    async runAction(action, playbackSpeed, ctxToRestore) {
+    async runAction(action, ctxToRestore) {
         this.stop();
 
-        playbackSpeed = playbackSpeed || 1;
-
         if (!action.ops.length) {
             return;
         }
@@ -97,14 +95,13 @@ export class ActionPlayback {
 
         return new Promise((resolve, reject) => {
             async function tick() {
-                // Date has multiplied playbackSpeed
                 let current = Date.now();
                 let dTime = current - self._current;
                 self._elapsedTime += dTime;
                 self._current = current;
 
                 try {
-                    await self._update(takeScreenshot, playbackSpeed);
+                    await self._update(takeScreenshot);
                 }
                 catch (e) {
                     // Stop running and throw error.
@@ -132,7 +129,7 @@ export class ActionPlayback {
         }
     }
 
-    async _update(takeScreenshot, playbackSpeed) {
+    async _update(takeScreenshot) {
         let op = this._ops[this._currentOpIndex];
 
         if (op.time > this._elapsedTime) {
@@ -194,7 +191,7 @@ export class ActionPlayback {
         if (nextOp && nextOp.type === 'screenshot-auto') {
             let delay = nextOp.delay == null ? 400 : nextOp.delay;
             // TODO Configuration time
-            await waitTime(delay / playbackSpeed);
+            await waitTime(delay);
             await takeScreenshot();
             screenshotTaken = true;
             this._currentOpIndex++;
diff --git a/test/runTest/runtime/main.js b/test/runTest/runtime/main.js
index 74147d0..712e77f 100644
--- a/test/runTest/runtime/main.js
+++ b/test/runTest/runtime/main.js
@@ -103,7 +103,7 @@ window.__VRT_RUN_ACTIONS__ = async function (actions, restoredActionIndex, resto
             continue;
         }
         window.scrollTo(action.scrollX, action.scrollY);
-        await actionPlayback.runAction(action, __VRT_PLAYBACK_SPEED__, index === restoredActionIndex ? restoredActionContext : null);
+        await actionPlayback.runAction(action, index === restoredActionIndex ? restoredActionContext : null);
 
     }
     actionPlayback.stop();

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org