diff --git a/static/js/socket.js b/static/js/socket.js index 796ff73b9f..39b6222448 100644 --- a/static/js/socket.js +++ b/static/js/socket.js @@ -14,6 +14,11 @@ function Socket(url) { this._supported_protocols = ['websocket', 'xdr-streaming', 'xhr-streaming', 'xdr-polling', 'xhr-polling', 'jsonp-polling']; + if (page_params.test_suite) { + this._supported_protocols = _.reject(this._supported_protocols, + function (x) { return x === 'xhr-streaming'; }); + } + this._sockjs = new SockJS(url, null, {protocols_whitelist: this._supported_protocols}); this._setup_sockjs_callbacks(this._sockjs); } diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 78faa4f12c..67134e7b96 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -704,6 +704,7 @@ def home(request): # These end up in a global JavaScript Object named 'page_params'. page_params = simplejson.encoder.JSONEncoderForHTML().encode(dict( debug_mode = settings.DEBUG, + test_suite = settings.TEST_SUITE, poll_timeout = settings.POLL_TIMEOUT, have_initial_messages = user_has_messages, stream_list = register_ret['subscriptions'],