Bug 1311645 - Test that ocsp is not separated for containers. r=keeler
--- a/security/manager/ssl/tests/unit/test_ocsp_caching.js
+++ b/security/manager/ssl/tests/unit/test_ocsp_caching.js
@@ -291,9 +291,34 @@ function add_tests() {
gObservedCnt = 0;
run_next_test();
});
//---------------------------------------------------------------------------
// Reset state
add_test(function() { clearOCSPCache(); run_next_test(); });
+
+ // Test that the OCSP cache is not isolated by userContextId.
+
+ // A good OCSP response will be cached.
+ add_ocsp_test("ocsp-stapling-none.example.com", PRErrorCodeSuccess,
+ [respondWithGoodOCSP],
+ "No stapled response (userContextId = 1) -> a fetch " +
+ "should have been attempted", { userContextId: 1 });
+
+ // The cache will prevent a fetch from happening.
+ add_ocsp_test("ocsp-stapling-none.example.com", PRErrorCodeSuccess, [],
+ "Noted OCSP server failure (userContextId = 1) -> a " +
+ "fetch should not have been attempted",
+ { userContextId: 1 });
+
+ // Fetching is prevented even if in a different userContextId.
+ add_ocsp_test("ocsp-stapling-none.example.com", PRErrorCodeSuccess, [],
+ "Noted OCSP server failure (userContextId = 2) -> a " +
+ "fetch should not have been attempted",
+ { userContextId: 2 });
+
+ //---------------------------------------------------------------------------
+
+ // Reset state
+ add_test(function() { clearOCSPCache(); run_next_test(); });
}