bug 866867 test_spdy.js flaky with parallel connections r=hurley

This commit is contained in:
Patrick McManus 2013-04-29 20:05:39 -04:00
parent 846414db04
commit 1626ec7a89
2 changed files with 7 additions and 2 deletions

View File

@ -2551,7 +2551,7 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, void *param)
if (preferredEntry)
ent = preferredEntry;
if (mNumHalfOpenConns <= gHttpHandler->ParallelSpeculativeConnectLimit() &&
if (mNumHalfOpenConns < gHttpHandler->ParallelSpeculativeConnectLimit() &&
!ent->mIdleConns.Length() && !RestrictConnections(ent) &&
!AtActiveConnectionLimit(ent, trans->Caps())) {
CreateTransport(ent, trans, trans->Caps(), true);

View File

@ -331,13 +331,18 @@ function addCertOverride(host, port, bits) {
function run_test() {
// Set to allow the cert presented by our SPDY server
do_get_profile();
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
addCertOverride("localhost", 4443,
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
Ci.nsICertOverrideService.ERROR_MISMATCH |
Ci.nsICertOverrideService.ERROR_TIME);
prefs.setIntPref("network.http.speculative-parallel-limit", oldPref);
// Make sure spdy is enabled
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
prefs.setBoolPref("network.http.spdy.enabled", true);
// And make go!