[Pkg-javascript-commits] [sockjs-client] 168/350: Don't attempt iframe test if the browser doesn't support them

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit 468347b34c013942b1a8f2d3d0a99fc93b8a6678
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Fri Oct 17 15:27:09 2014 -0400

    Don't attempt iframe test if the browser doesn't support them
---
 lib/transport/browser/abstract-xhr.js | 2 +-
 tests/lib/echo-tests.js               | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/transport/browser/abstract-xhr.js b/lib/transport/browser/abstract-xhr.js
index a29465b..5218699 100644
--- a/lib/transport/browser/abstract-xhr.js
+++ b/lib/transport/browser/abstract-xhr.js
@@ -153,7 +153,7 @@ if (!AbstractXHRObject.enabled && global.ActiveXObject) {
 }
 
 var cors = false;
-try { cors = 'withCredentials' in new global.XMLHttpRequest(); }
+try { cors = 'withCredentials' in new XHR(); }
 catch (ignored) {}
 
 AbstractXHRObject.supportsCORS = cors;
diff --git a/tests/lib/echo-tests.js b/tests/lib/echo-tests.js
index a31b5b1..e4dd72d 100644
--- a/tests/lib/echo-tests.js
+++ b/tests/lib/echo-tests.js
@@ -1,5 +1,6 @@
 'use strict';
 var expect = require('expect.js')
+  , iframeUtils = require('../../lib/utils/iframe')
   , testUtils = require('./test-utils')
   , debug = require('debug')('sockjs-client:tests:echo')
   ;
@@ -88,6 +89,11 @@ module.exports.echoUtfEncoding = function echoUtfEncoding(transport) {
 
 module.exports.echoFromChild = function echoFromChild(transport) {
   it('echo from child', function (done) {
+    if (!iframeUtils.iframeEnabled) {
+      done();
+      return;
+    }
+
     var title = this.runnable().fullTitle();
     debug('start', title);
     var hook = testUtils.createIframe('/sockjs-in-parent.html');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list