Skip to content

Commit

Permalink
fix(client): clearContext after complete sent
Browse files Browse the repository at this point in the history
When useiframe false and clearContext true and IE11, the clearContext
blocks the complete event.
  • Loading branch information
johnjbarton committed Feb 22, 2021
1 parent f52a071 commit 27af5f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions client/karma.js
Expand Up @@ -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
}
Expand Down
7 changes: 3 additions & 4 deletions static/karma.js
Expand Up @@ -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
}
Expand Down

0 comments on commit 27af5f7

Please sign in to comment.