From fd0dae0214ded044d040bb18776b0ce909506d9e Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Tue, 25 Apr 2017 11:29:02 +0200 Subject: [PATCH] Bug 1335778 - Make switchToFrame synchronous for in-process frames. r=ato In the case of switching to an in-process frame, the checkLoad timer is setup which waits for the frame's content to finish loading. But the command doesn't actually wait for those events and calls sendResponse() immediately. This causes a race condition for the following commands. MozReview-Commit-ID: 6vuQ7paQ55K --HG-- extra : rebase_source : ceb590f435d84ead4eba2e718e1ebaa01900d33f --- testing/marionette/listener.js | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js index 1d0899879896..5cc7855def94 100644 --- a/testing/marionette/listener.js +++ b/testing/marionette/listener.js @@ -1606,6 +1606,7 @@ function switchToFrame(msg) { curContainer.frame.focus(); } checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT); + return; } sendResponse(rv, command_id);