Skip to content

Commit c0962e3

Browse files
authoredMar 24, 2021
fix(client): clearContext after complete sent (#3657)
When useiframe false and clearContext true and IE11, the clearContext blocks the complete event.
1 parent 3eb7ee7 commit c0962e3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
 

‎client/karma.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,12 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
236236
// to ensure the error from an incorrect navigate is processed.
237237
var config = this.config
238238
setTimeout(function () {
239+
socket.emit('complete', result || {})
239240
if (config.clearContext) {
240241
navigateContextTo('about:blank')
242+
} else {
243+
self.updater.updateTestStatus('complete')
241244
}
242-
243-
socket.emit('complete', result || {})
244-
self.updater.updateTestStatus('complete')
245-
246245
if (returnUrl) {
247246
location.href = returnUrl
248247
}

‎static/karma.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,12 @@ function Karma (updater, socket, iframe, opener, navigator, location, document)
246246
// to ensure the error from an incorrect navigate is processed.
247247
var config = this.config
248248
setTimeout(function () {
249+
socket.emit('complete', result || {})
249250
if (config.clearContext) {
250251
navigateContextTo('about:blank')
252+
} else {
253+
self.updater.updateTestStatus('complete')
251254
}
252-
253-
socket.emit('complete', result || {})
254-
self.updater.updateTestStatus('complete')
255-
256255
if (returnUrl) {
257256
location.href = returnUrl
258257
}

0 commit comments

Comments
 (0)
Please sign in to comment.