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

Unified Diff: net/android/http_auth_negotiate_android_unittest.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to cbentzel@'s comments. Created 5 years 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/android/http_auth_negotiate_android.cc ('k') | net/http/http_auth.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/http_auth_negotiate_android_unittest.cc
diff --git a/net/android/http_auth_negotiate_android_unittest.cc b/net/android/http_auth_negotiate_android_unittest.cc
index b1e178f588d0be3c2905e868be3f3d5c5cfbb814..8e3de79485c1f2c75748048befaf5dc70b2b81a6 100644
--- a/net/android/http_auth_negotiate_android_unittest.cc
+++ b/net/android/http_auth_negotiate_android_unittest.cc
@@ -8,6 +8,7 @@
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/http/http_auth_challenge_tokenizer.h"
+#include "net/http/mock_allow_http_auth_preferences.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -23,7 +24,10 @@ TEST(HttpAuthNegotiateAndroidTest, GenerateAuthToken) {
authenticator.ExpectSecurityContext("Negotiate", GSS_S_COMPLETE, 0,
mockContext, "", "DummyToken");
- HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ MockAllowHttpAuthPreferences prefs;
+ prefs.set_auth_android_negotiate_account_type(
+ "org.chromium.test.DummySpnegoAuthenticator");
+ HttpAuthNegotiateAndroid auth(&prefs);
EXPECT_TRUE(auth.Init());
TestCompletionCallback callback;
@@ -37,7 +41,10 @@ TEST(HttpAuthNegotiateAndroidTest, GenerateAuthToken) {
TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_FirstRound) {
// The first round should just consist of an unadorned "Negotiate" header.
- HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ MockAllowHttpAuthPreferences prefs;
+ prefs.set_auth_android_negotiate_account_type(
+ "org.chromium.test.DummySpnegoAuthenticator");
+ HttpAuthNegotiateAndroid auth(&prefs);
std::string challenge_text = "Negotiate";
HttpAuthChallengeTokenizer challenge(challenge_text.begin(),
challenge_text.end());
@@ -48,7 +55,10 @@ TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_FirstRound) {
TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_UnexpectedTokenFirstRound) {
// If the first round challenge has an additional authentication token, it
// should be treated as an invalid challenge from the server.
- HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ MockAllowHttpAuthPreferences prefs;
+ prefs.set_auth_android_negotiate_account_type(
+ "org.chromium.test.DummySpnegoAuthenticator");
+ HttpAuthNegotiateAndroid auth(&prefs);
std::string challenge_text = "Negotiate Zm9vYmFy";
HttpAuthChallengeTokenizer challenge(challenge_text.begin(),
challenge_text.end());
@@ -59,7 +69,10 @@ TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_UnexpectedTokenFirstRound) {
TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_TwoRounds) {
// The first round should just have "Negotiate", and the second round should
// have a valid base64 token associated with it.
- HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ MockAllowHttpAuthPreferences prefs;
+ prefs.set_auth_android_negotiate_account_type(
+ "org.chromium.test.DummySpnegoAuthenticator");
+ HttpAuthNegotiateAndroid auth(&prefs);
std::string first_challenge_text = "Negotiate";
HttpAuthChallengeTokenizer first_challenge(first_challenge_text.begin(),
first_challenge_text.end());
@@ -76,7 +89,10 @@ TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_TwoRounds) {
TEST(HttpAuthNegotiateAndroidTest, ParseChallenge_MissingTokenSecondRound) {
// If a later-round challenge is simply "Negotiate", it should be treated as
// an authentication challenge rejection from the server or proxy.
- HttpAuthNegotiateAndroid auth("org.chromium.test.DummySpnegoAuthenticator");
+ MockAllowHttpAuthPreferences prefs;
+ prefs.set_auth_android_negotiate_account_type(
+ "org.chromium.test.DummySpnegoAuthenticator");
+ HttpAuthNegotiateAndroid auth(&prefs);
std::string first_challenge_text = "Negotiate";
HttpAuthChallengeTokenizer first_challenge(first_challenge_text.begin(),
first_challenge_text.end());
« no previous file with comments | « net/android/http_auth_negotiate_android.cc ('k') | net/http/http_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698