Bug 1328726 - Make performActions and releaseActions blocking. r=ato, a=test-only
authorMaja Frydrychowicz <mjzffr@gmail.com>
Wed, 11 Jan 2017 10:26:22 -0500
changeset 376525 d9e64da4d0419653bd6b4b22864e0a386f2702b4
parent 376524 a43ef146176a4ab0338d96de4d1218520ad52fc4
child 376526 5b1d46b36da7c51af990b3c0ad3690a10d8f780f
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1328726
milestone53.0a2
Bug 1328726 - Make performActions and releaseActions blocking. r=ato, a=test-only Now the server response isn't sent until the command's Promise is resolved. MozReview-Commit-ID: LUdL6mZQ5jE
testing/marionette/listener.js
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -680,29 +680,29 @@ function createATouch(el, corx, cory, to
 
 /**
  * Perform a series of grouped actions at the specified points in time.
  *
  * @param {obj} msg
  *      Object with an |actions| attribute that is an Array of objects
  *      each of which represents an action sequence.
  */
-function performActions(msg) {
+function* performActions(msg) {
   let chain = action.Chain.fromJson(msg.actions);
-  action.dispatch(chain, seenEls, curContainer);
+  yield action.dispatch(chain, seenEls, curContainer);
 }
 
 /**
  * The Release Actions command is used to release all the keys and pointer
  * buttons that are currently depressed. This causes events to be fired as if
  * the state was released by an explicit series of actions. It also clears all
  * the internal state of the virtual devices.
  */
-function releaseActions() {
-  action.dispatchTickActions(action.inputsToCancel.reverse(), 0, seenEls, curContainer);
+function* releaseActions() {
+  yield action.dispatchTickActions(action.inputsToCancel.reverse(), 0, seenEls, curContainer);
   action.inputsToCancel.length = 0;
   action.inputStateMap.clear();
 }
 
 /**
  * Start action chain on one finger.
  */
 function actionChain(chain, touchId) {