[Pkg-javascript-commits] [sockjs-client] 65/350: Fix XDR tests

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:42 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 a2b3b2baf8cafe62de78a7866c3ffe2cca639e0f
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Fri May 30 10:32:43 2014 -0400

    Fix XDR tests
---
 lib/trans-xdr-polling.js   | 4 ++--
 lib/trans-xdr-streaming.js | 4 ++--
 tests/server.js            | 3 +++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/trans-xdr-polling.js b/lib/trans-xdr-polling.js
index f44a88b..9a78871 100644
--- a/lib/trans-xdr-polling.js
+++ b/lib/trans-xdr-polling.js
@@ -9,11 +9,11 @@
 
 var AjaxBasedTransport = require('./ajax-based');
 var XdrStreamingTransport = require('./trans-xdr-streaming');
-var utils = require('./utils');
 var XhrReceiver = require('./trans-receiver-xhr');
+var XDRObject = require('./xdr');
 
 function XdrPollingTransport(ri, trans_url) {
-    this.run(ri, trans_url, '/xhr', XhrReceiver, utils.XDRObject);
+    this.run(ri, trans_url, '/xhr', XhrReceiver, XDRObject);
 }
 
 XdrPollingTransport.prototype = new AjaxBasedTransport();
diff --git a/lib/trans-xdr-streaming.js b/lib/trans-xdr-streaming.js
index 7e386d8..1d69965 100644
--- a/lib/trans-xdr-streaming.js
+++ b/lib/trans-xdr-streaming.js
@@ -9,14 +9,14 @@
 
 var AjaxBasedTransport = require('./ajax-based');
 var XhrReceiver = require('./trans-receiver-xhr');
-var utils = require('./utils');
+var XDRObject = require('./xdr');
 
 // According to:
 //   http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
 //   http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
 
 function XdrStreamingTransport(ri, trans_url) {
-    this.run(ri, trans_url, '/xhr_streaming', XhrReceiver, utils.XDRObject);
+    this.run(ri, trans_url, '/xhr_streaming', XhrReceiver, XDRObject);
 }
 
 XdrStreamingTransport.prototype = new AjaxBasedTransport();
diff --git a/tests/server.js b/tests/server.js
index 920af81..e0d5edb 100644
--- a/tests/server.js
+++ b/tests/server.js
@@ -2,6 +2,7 @@
 
 var http = require('http');
 var node_static = require('node-static');
+var url = require('url');
 
 var config = require('./config').config;
 
@@ -30,6 +31,8 @@ server.addListener('request', function(req, res) {
         res.writeHead(200);
         res.end(new Array(2049).join('a') + '\nb\n');
     } else if (req.url === '/config.js') {
+        var parsedOrigin = url.parse(req.headers.referer || 'http://localhost');
+        config.client_opts.url = parsedOrigin.protocol + '//' + parsedOrigin.hostname + ':8081';
         res.setHeader('content-type', 'application/javascript');
         res.writeHead(200);
         res.end('var client_opts = ' +

-- 
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