From c0962e34fb2c0a7a43bead8d600ad4a6dbb29c3d Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Wed, 24 Mar 2021 14:07:14 -0700 Subject: [PATCH] fix(client): clearContext after complete sent (#3657) When useiframe false and clearContext true and IE11, the clearContext blocks the complete event. --- client/karma.js | 7 +++---- static/karma.js | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/karma.js b/client/karma.js index 5586bdc9e..0cc7556e0 100644 --- a/client/karma.js +++ b/client/karma.js @@ -236,13 +236,12 @@ function Karma (updater, socket, iframe, opener, navigator, location, document) // to ensure the error from an incorrect navigate is processed. var config = this.config setTimeout(function () { + socket.emit('complete', result || {}) if (config.clearContext) { navigateContextTo('about:blank') + } else { + self.updater.updateTestStatus('complete') } - - socket.emit('complete', result || {}) - self.updater.updateTestStatus('complete') - if (returnUrl) { location.href = returnUrl } diff --git a/static/karma.js b/static/karma.js index 23b7c1ae2..b630fe256 100644 --- a/static/karma.js +++ b/static/karma.js @@ -246,13 +246,12 @@ function Karma (updater, socket, iframe, opener, navigator, location, document) // to ensure the error from an incorrect navigate is processed. var config = this.config setTimeout(function () { + socket.emit('complete', result || {}) if (config.clearContext) { navigateContextTo('about:blank') + } else { + self.updater.updateTestStatus('complete') } - - socket.emit('complete', result || {}) - self.updater.updateTestStatus('complete') - if (returnUrl) { location.href = returnUrl }