| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_auth_controller.h" | 5 #include "net/http/http_auth_controller.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
| 10 #include "net/http/http_auth_cache.h" | 10 #include "net/http/http_auth_cache.h" |
| 11 #include "net/http/http_auth_challenge_tokenizer.h" | 11 #include "net/http/http_auth_challenge_tokenizer.h" |
| 12 #include "net/http/http_auth_handler_mock.h" | 12 #include "net/http/http_auth_handler_mock.h" |
| 13 #include "net/http/http_request_info.h" | 13 #include "net/http/http_request_info.h" |
| 14 #include "net/http/http_response_headers.h" | 14 #include "net/http/http_response_headers.h" |
| 15 #include "net/http/http_util.h" | 15 #include "net/http/http_util.h" |
| 16 #include "net/log/net_log.h" | 16 #include "net/log/net_log_with_source.h" |
| 17 #include "net/ssl/ssl_info.h" | 17 #include "net/ssl/ssl_info.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 enum HandlerRunMode { | 24 enum HandlerRunMode { |
| 25 RUN_HANDLER_SYNC, | 25 RUN_HANDLER_SYNC, |
| 26 RUN_HANDLER_ASYNC | 26 RUN_HANDLER_ASYNC |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 EXPECT_TRUE(controller->HaveAuth()); | 234 EXPECT_TRUE(controller->HaveAuth()); |
| 235 EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK)); | 235 EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK)); |
| 236 EXPECT_FALSE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_BASIC)); | 236 EXPECT_FALSE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_BASIC)); |
| 237 | 237 |
| 238 // Should only succeed if we are using the AUTH_SCHEME_BASIC MockHandler. | 238 // Should only succeed if we are using the AUTH_SCHEME_BASIC MockHandler. |
| 239 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken( | 239 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken( |
| 240 &request, CompletionCallback(), dummy_log)); | 240 &request, CompletionCallback(), dummy_log)); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace net | 243 } // namespace net |
| OLD | NEW |