| 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 "chromeos/dbus/services/proxy_resolution_service_provider.h" | 5 #include "chromeos/dbus/services/proxy_resolution_service_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 // Helper method for the destructor that resets |proxy_service_|. | 172 // Helper method for the destructor that resets |proxy_service_|. |
| 173 void DeleteProxyServiceOnNetworkThread() { | 173 void DeleteProxyServiceOnNetworkThread() { |
| 174 CHECK(context_getter_->GetNetworkTaskRunner()->BelongsToCurrentThread()); | 174 CHECK(context_getter_->GetNetworkTaskRunner()->BelongsToCurrentThread()); |
| 175 proxy_service_.reset(); | 175 proxy_service_.reset(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 net::ProxyResolver* proxy_resolver_; // Not owned. | 178 net::ProxyResolver* proxy_resolver_; // Not owned. |
| 179 | 179 |
| 180 // Created, used, and destroyed on the network thread (since net::ProxyService | 180 // Created, used, and destroyed on the network thread (since net::ProxyService |
| 181 // derives from base::NonThreadSafe). | 181 // is thread-affine (uses ThreadChecker)). |
| 182 std::unique_ptr<net::ProxyService> proxy_service_; | 182 std::unique_ptr<net::ProxyService> proxy_service_; |
| 183 | 183 |
| 184 scoped_refptr<net::TestURLRequestContextGetter> context_getter_; | 184 scoped_refptr<net::TestURLRequestContextGetter> context_getter_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(TestDelegate); | 186 DISALLOW_COPY_AND_ASSIGN(TestDelegate); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace | 189 } // namespace |
| 190 | 190 |
| 191 class ProxyResolutionServiceProviderTest : public testing::Test { | 191 class ProxyResolutionServiceProviderTest : public testing::Test { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 EXPECT_TRUE(reader.PopString(&error)); | 409 EXPECT_TRUE(reader.PopString(&error)); |
| 410 EXPECT_EQ("DIRECT", proxy_info); | 410 EXPECT_EQ("DIRECT", proxy_info); |
| 411 EXPECT_EQ(net::ErrorToString(net::ERR_MANDATORY_PROXY_CONFIGURATION_FAILED), | 411 EXPECT_EQ(net::ErrorToString(net::ERR_MANDATORY_PROXY_CONFIGURATION_FAILED), |
| 412 error); | 412 error); |
| 413 | 413 |
| 414 // No signal should've been emitted. | 414 // No signal should've been emitted. |
| 415 EXPECT_FALSE(signal); | 415 EXPECT_FALSE(signal); |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace chromeos | 418 } // namespace chromeos |
| OLD | NEW |