Skip to content

Commit

Permalink
fix(client): clearContext after complete sent (#3657)
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 authored Mar 24, 2021
1 parent 3eb7ee7 commit c0962e3
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 c0962e3

Please sign in to comment.