| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 class ProxyResolutionServiceProviderTest : public testing::Test { | 50 class ProxyResolutionServiceProviderTest : public testing::Test { |
| 51 public: | 51 public: |
| 52 void SetUp() override { | 52 void SetUp() override { |
| 53 // Create the proxy resolution service with the mock bus and the mock | 53 // Create the proxy resolution service with the mock bus and the mock |
| 54 // resolver injected. | 54 // resolver injected. |
| 55 service_provider_.reset(ProxyResolutionServiceProvider::Create( | 55 service_provider_.reset(ProxyResolutionServiceProvider::Create( |
| 56 base::WrapUnique(new TestProxyResolverDelegate( | 56 base::MakeUnique<TestProxyResolverDelegate>( |
| 57 base::ThreadTaskRunnerHandle::Get())))); | 57 base::ThreadTaskRunnerHandle::Get()))); |
| 58 | 58 |
| 59 test_helper_.SetUp(kResolveNetworkProxy, service_provider_.get()); | 59 test_helper_.SetUp(kResolveNetworkProxy, service_provider_.get()); |
| 60 | 60 |
| 61 // Connect to the signal that will be sent to kReturnSignalInterface and | 61 // Connect to the signal that will be sent to kReturnSignalInterface and |
| 62 // kReturnSignalName. ResolveNetworkProxy() will send the result as a | 62 // kReturnSignalName. ResolveNetworkProxy() will send the result as a |
| 63 // signal. OnSignalReceived() will be called upon the delivery. | 63 // signal. OnSignalReceived() will be called upon the delivery. |
| 64 test_helper_.SetUpReturnSignal( | 64 test_helper_.SetUpReturnSignal( |
| 65 kReturnSignalInterface, | 65 kReturnSignalInterface, |
| 66 kReturnSignalName, | 66 kReturnSignalName, |
| 67 base::Bind(&ProxyResolutionServiceProviderTest::OnSignalReceived, | 67 base::Bind(&ProxyResolutionServiceProviderTest::OnSignalReceived, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 dbus::MessageReader reader(response.get()); | 125 dbus::MessageReader reader(response.get()); |
| 126 EXPECT_FALSE(reader.HasMoreData()); | 126 EXPECT_FALSE(reader.HasMoreData()); |
| 127 | 127 |
| 128 // Confirm that the signal is received successfully. | 128 // Confirm that the signal is received successfully. |
| 129 EXPECT_EQ(kSourceURL, source_url_); | 129 EXPECT_EQ(kSourceURL, source_url_); |
| 130 EXPECT_EQ("DIRECT", proxy_info_); | 130 EXPECT_EQ("DIRECT", proxy_info_); |
| 131 EXPECT_EQ("", error_message_); | 131 EXPECT_EQ("", error_message_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace chromeos | 134 } // namespace chromeos |
| OLD | NEW |