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

Unified Diff: net/http/http_auth_cache_unittest.cc

Issue 28144: Implement the NTLM authentication scheme by porting... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Final upload before checkin Created 11 years, 10 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_auth.cc ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_cache_unittest.cc
===================================================================
--- net/http/http_auth_cache_unittest.cc (revision 10666)
+++ net/http/http_auth_cache_unittest.cc (working copy)
@@ -20,9 +20,10 @@
realm_ = realm;
score_ = 1;
target_ = target;
+ properties_ = 0;
}
-
- virtual std::string GenerateCredentials(const std::wstring&,
+
+ virtual std::string GenerateCredentials(const std::wstring&,
const std::wstring&,
const HttpRequestInfo*,
const ProxyInfo*) {
@@ -35,14 +36,14 @@
}
};
-} // namespace
+} // namespace
// Test adding and looking-up cache entries (both by realm and by path).
TEST(HttpAuthCacheTest, Basic) {
GURL origin("http://www.google.com");
HttpAuthCache cache;
HttpAuthCache::Entry* entry;
-
+
// Add cache entries for 3 realms: "Realm1", "Realm2", "Realm3"
scoped_refptr<HttpAuthHandler> realm1_handler =
@@ -80,7 +81,7 @@
EXPECT_TRUE(entry->handler() == realm2_handler.get());
EXPECT_EQ(L"realm2-user", entry->username());
EXPECT_EQ(L"realm2-password", entry->password());
-
+
// Check that subpaths are recognized.
HttpAuthCache::Entry* realm2Entry = cache.LookupByRealm(origin, "Realm2");
EXPECT_FALSE(NULL == realm2Entry);
@@ -161,7 +162,7 @@
EXPECT_TRUE(entry == orig_entry);
EXPECT_EQ(L"user3", entry->username());
EXPECT_EQ(L"password3", entry->password());
-
+
EXPECT_EQ(2U, entry->paths_.size());
EXPECT_EQ("/z/", entry->paths_.front());
EXPECT_EQ("/x/y/z/", entry->paths_.back());
@@ -183,7 +184,7 @@
cache.Add(origin, realm1_handler, L"alice", L"123", "/");
cache.Add(origin, realm2_handler, L"bob", L"princess", "/");
cache.Add(origin, realm3_handler, L"admin", L"password", "/");
-
+
// Fails, because there is no realm "Realm4".
EXPECT_FALSE(cache.Remove(origin, "Realm4", L"alice", L"123"));
@@ -270,7 +271,7 @@
for (int i = 0; i < 3; ++i)
AddRealm(i + kMaxRealms);
-
+
for (int i = 0; i < 3; ++i)
CheckRealmExistence(i, false);
@@ -301,4 +302,4 @@
CheckRealmExistence(i, true);
}
-} // namespace net
+} // namespace net
« no previous file with comments | « net/http/http_auth.cc ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698