From: Wolfram Schneider Date: Tue, 9 Dec 2014 10:22:28 +0000 (+0000) Subject: Workaround for phantomjs 1.9.8 bug, MKWS-343 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=443fb8aca09c888a0d119f46903b29105d220dd6;hp=31898c6914fe6358e2404e3eac28de95385ecf83;p=mkws-moved-to-github.git Workaround for phantomjs 1.9.8 bug, MKWS-343 This will avoid the error message: Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://phantom/run-jasmine.js. Domains, protocols and ports must match. after the tests runs. --- diff --git a/test/phantom/run-jasmine.js b/test/phantom/run-jasmine.js index ef0577a..e9bf784 100644 --- a/test/phantom/run-jasmine.js +++ b/test/phantom/run-jasmine.js @@ -46,7 +46,11 @@ function wait_for_jasmine(checkFx, readyFx, failFx, timeout) { clearInterval(interval); result.time = (new Date().getTime() - start); result.failed ? failFx(result) : readyFx(result); - phantom.exit(result.failed == 0 ? 0 : 2); + + // See: https://github.com/ariya/phantomjs/issues/12697 + // phantomjs 1.9.8 + page.close(); + setTimeout(function(){ phantom.exit(result.failed == 0 ? 0 : 2); }, 0); } // timeout