Disallow XHR streaming when running the test suite

There seems to be some sort of bug involving PhantomJS and XHR
streaming messages.  When successive pages are loaded that use XHR
streaming, PhantomJS seems to think the second one never finishes
loading and therefore hangs.

(imported from commit db93b4cab816f1fdc3f3f543c9394b1cba8abedb)
This commit is contained in:
Zev Benjamin 2013-10-11 15:36:49 -04:00
parent b1eebc0b84
commit 89bcabbb65
2 changed files with 6 additions and 0 deletions

View File

@ -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);
}

View File

@ -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'],