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 "content/browser/resolve_proxy_msg_helper.h" | 5 #include "content/browser/resolve_proxy_msg_helper.h" |
6 | 6 |
7 #include "content/browser/browser_thread_impl.h" | 7 #include "content/browser/browser_thread_impl.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "ipc/ipc_test_sink.h" | 9 #include "ipc/ipc_test_sink.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/proxy/mock_proxy_resolver.h" | 11 #include "net/proxy/mock_proxy_resolver.h" |
12 #include "net/proxy/proxy_config_service.h" | 12 #include "net/proxy/proxy_config_service.h" |
13 #include "net/proxy/proxy_service.h" | 13 #include "net/proxy/proxy_service.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using content::BrowserThread; | 16 namespace content { |
17 using content::BrowserThreadImpl; | |
18 | 17 |
19 // This ProxyConfigService always returns "http://pac" as the PAC url to use. | 18 // This ProxyConfigService always returns "http://pac" as the PAC url to use. |
20 class MockProxyConfigService : public net::ProxyConfigService { | 19 class MockProxyConfigService : public net::ProxyConfigService { |
21 public: | 20 public: |
22 virtual void AddObserver(Observer* observer) {} | 21 virtual void AddObserver(Observer* observer) {} |
23 virtual void RemoveObserver(Observer* observer) {} | 22 virtual void RemoveObserver(Observer* observer) {} |
24 virtual ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* results) { | 23 virtual ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* results) { |
25 *results = net::ProxyConfig::CreateFromCustomPacURL(GURL("http://pac")); | 24 *results = net::ProxyConfig::CreateFromCustomPacURL(GURL("http://pac")); |
26 return CONFIG_VALID; | 25 return CONFIG_VALID; |
27 } | 26 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 227 |
229 // The pending requests sent to the proxy resolver should have been cancelled. | 228 // The pending requests sent to the proxy resolver should have been cancelled. |
230 | 229 |
231 EXPECT_EQ(0u, resolver_->pending_requests().size()); | 230 EXPECT_EQ(0u, resolver_->pending_requests().size()); |
232 | 231 |
233 EXPECT_TRUE(pending_result() == NULL); | 232 EXPECT_TRUE(pending_result() == NULL); |
234 | 233 |
235 // It should also be the case that msg1, msg2, msg3 were deleted by the | 234 // It should also be the case that msg1, msg2, msg3 were deleted by the |
236 // cancellation. (Else will show up as a leak in Valgrind). | 235 // cancellation. (Else will show up as a leak in Valgrind). |
237 } | 236 } |
| 237 |
| 238 } // namespace content |
OLD | NEW |