Permalink
Browse files

Improve tests to close browser window on test completion

  • Loading branch information...
1 parent 37775aa commit 5455bf86ccb87e57ed84cc766e130cf9d47467b9 @nikhilk committed Sep 12, 2012
@@ -23,6 +23,12 @@
var logUrl = '/log/' + ((failures === 0) ? 'success' : 'failure');
var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ window.open('', '_self', '');
+ window.close();
+ }
+ };
xhr.open('POST', logUrl, /* async */ false);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send(logData);
@@ -23,6 +23,12 @@
var logUrl = '/log/' + ((failures === 0) ? 'success' : 'failure');
var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ window.open('', '_self', '');
+ window.close();
+ }
+ };
xhr.open('POST', logUrl, /* async */ false);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send(logData);
@@ -23,6 +23,12 @@
var logUrl = '/log/' + ((failures === 0) ? 'success' : 'failure');
var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ window.open('', '_self', '');
+ window.close();
+ }
+ };
xhr.open('POST', logUrl, /* async */ false);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send(logData);

0 comments on commit 5455bf8

Please sign in to comment.