Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: net/http/http_cache_unittest.cc

Issue 6804032: Add TLS-SRP (RFC 5054) support Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: remove "httpsv" scheme, minor NSS/OpenSSL changes Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_unittest.cc
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index bf8cb6bd27230be5f85aa33a83dbc4f4b371bc38..9fc6745130b7e7818af4d4a55d32ffab88b91d24 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -9,6 +9,7 @@
#include "base/scoped_vector.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/utf_string_conversions.h"
#include "net/base/cache_type.h"
#include "net/base/cert_status_flags.h"
#include "net/base/load_flags.h"
@@ -814,7 +815,8 @@ const MockTransaction kFastNoStoreGET_Transaction = {
"<html><body>Google Blah Blah</body></html>",
TEST_MODE_SYNC_NET_START,
&FastTransactionServer::FastNoStoreHandler,
- 0
+ 0,
+ string16()
};
// This class provides a handler for kRangeGET_TransactionOK so that the range
@@ -949,7 +951,8 @@ const MockTransaction kRangeGET_TransactionOK = {
"rg: 40-49 ",
TEST_MODE_NORMAL,
&RangeTransactionServer::RangeHandler,
- 0
+ 0,
+ string16()
};
// Verifies the response headers (|response|) match a partial content
@@ -4613,6 +4616,23 @@ TEST(HttpCache, SimpleGET_SSLError) {
ASSERT_EQ(net::ERR_CACHE_MISS, rv);
}
+// Ensure we cache the TLS username in SSLInfo.
+TEST(HttpCache, CachesTLSUsername) {
+ MockHttpCache cache;
+
+ MockTransaction transaction = kSimpleGET_Transaction;
+ transaction.tls_username = ASCIIToUTF16("user");
+ ScopedMockTransaction scoped_transaction(transaction);
+
+ // write to the cache
+ RunTransactionTest(cache.http_cache(), transaction);
+
+ net::HttpResponseInfo response;
+ RunTransactionTestWithResponseInfo(cache.http_cache(), transaction,
+ &response);
+ EXPECT_EQ(ASCIIToUTF16("user"), response.ssl_info.tls_username);
+}
+
// Ensure that we don't crash by if left-behind transactions.
TEST(HttpCache, OutlivedTransactions) {
MockHttpCache* cache = new MockHttpCache;
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698