| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_preferences.h" | 5 #include "net/http/http_auth_preferences.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/prefs/pref_registry_simple.h" | |
| 12 #include "base/prefs/testing_pref_service.h" | |
| 13 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 15 |
| 18 namespace net { | 16 namespace net { |
| 19 | 17 |
| 20 TEST(HttpAuthPreferencesTest, AuthSchemes) { | 18 TEST(HttpAuthPreferencesTest, AuthSchemes) { |
| 21 const char* const expected_schemes[] = {"scheme1", "scheme2"}; | 19 const char* const expected_schemes[] = {"scheme1", "scheme2"}; |
| 22 std::vector<std::string> expected_schemes_vector( | 20 std::vector<std::string> expected_schemes_vector( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 "" | 103 "" |
| 106 #endif | 104 #endif |
| 107 ); | 105 ); |
| 108 // Check initial value | 106 // Check initial value |
| 109 EXPECT_FALSE(http_auth_preferences.CanDelegate(GURL("abc"))); | 107 EXPECT_FALSE(http_auth_preferences.CanDelegate(GURL("abc"))); |
| 110 http_auth_preferences.set_delegate_whitelist("*"); | 108 http_auth_preferences.set_delegate_whitelist("*"); |
| 111 EXPECT_TRUE(http_auth_preferences.CanDelegate(GURL("abc"))); | 109 EXPECT_TRUE(http_auth_preferences.CanDelegate(GURL("abc"))); |
| 112 } | 110 } |
| 113 | 111 |
| 114 } // namespace net | 112 } // namespace net |
| OLD | NEW |