Skip to content

Commit

Permalink
Merge dafc9fb into ead31cd
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjbarton authored Oct 2, 2020
2 parents ead31cd + dafc9fb commit fdda6d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var util = require('../common/util')

function Karma (socket, iframe, opener, navigator, location, document) {
var startEmitted = false
var reloadingContext = false
var karmaNavigating = false
var self = this
var queryParams = util.parseQueryParams(location.search)
var browserId = queryParams.id || util.generateId('manual-')
Expand Down Expand Up @@ -80,6 +80,7 @@ function Karma (socket, iframe, opener, navigator, location, document) {

var childWindow = null
function navigateContextTo (url) {
karmaNavigating = true
if (self.config.useIframe === false) {
// run in new window
if (self.config.runInParent === false) {
Expand Down Expand Up @@ -115,6 +116,7 @@ function Karma (socket, iframe, opener, navigator, location, document) {
}
document.body.appendChild(ele)
} else {
karmaNavigating = false
window.__karma__.loaded()
}
}
Expand All @@ -127,16 +129,14 @@ function Karma (socket, iframe, opener, navigator, location, document) {
}

this.onbeforeunload = function () {
if (!reloadingContext) {
if (!karmaNavigating) {
// TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL)
self.error('Some of your tests did a full page reload!')
}
reloadingContext = false
karmaNavigating = false
}

function clearContext () {
reloadingContext = true

navigateContextTo('about:blank')
}

Expand Down

0 comments on commit fdda6d6

Please sign in to comment.