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" |
(...skipping 41 matching lines...) Loading... |
52 const std::string& proxy_list) | 52 const std::string& proxy_list) |
53 : result(result), proxy_list(proxy_list) { | 53 : result(result), proxy_list(proxy_list) { |
54 } | 54 } |
55 | 55 |
56 bool result; | 56 bool result; |
57 std::string proxy_list; | 57 std::string proxy_list; |
58 }; | 58 }; |
59 | 59 |
60 ResolveProxyMsgHelperTest() | 60 ResolveProxyMsgHelperTest() |
61 : resolver_factory_(new net::MockAsyncProxyResolverFactory(false)), | 61 : resolver_factory_(new net::MockAsyncProxyResolverFactory(false)), |
62 service_(new net::ProxyService(new MockProxyConfigService, | 62 service_( |
63 make_scoped_ptr(resolver_factory_), | 63 new net::ProxyService(make_scoped_ptr(new MockProxyConfigService), |
64 NULL)), | 64 make_scoped_ptr(resolver_factory_), |
| 65 NULL)), |
65 helper_(new TestResolveProxyMsgHelper(service_.get(), this)), | 66 helper_(new TestResolveProxyMsgHelper(service_.get(), this)), |
66 io_thread_(BrowserThread::IO, &message_loop_) { | 67 io_thread_(BrowserThread::IO, &message_loop_) { |
67 test_sink_.AddFilter(this); | 68 test_sink_.AddFilter(this); |
68 } | 69 } |
69 | 70 |
70 protected: | 71 protected: |
71 const PendingResult* pending_result() const { return pending_result_.get(); } | 72 const PendingResult* pending_result() const { return pending_result_.get(); } |
72 | 73 |
73 void clear_pending_result() { | 74 void clear_pending_result() { |
74 pending_result_.reset(); | 75 pending_result_.reset(); |
(...skipping 181 matching lines...) Loading... |
256 | 257 |
257 EXPECT_EQ(0u, resolver_.pending_requests().size()); | 258 EXPECT_EQ(0u, resolver_.pending_requests().size()); |
258 | 259 |
259 EXPECT_TRUE(pending_result() == NULL); | 260 EXPECT_TRUE(pending_result() == NULL); |
260 | 261 |
261 // It should also be the case that msg1, msg2, msg3 were deleted by the | 262 // It should also be the case that msg1, msg2, msg3 were deleted by the |
262 // cancellation. (Else will show up as a leak in Valgrind). | 263 // cancellation. (Else will show up as a leak in Valgrind). |
263 } | 264 } |
264 | 265 |
265 } // namespace content | 266 } // namespace content |
OLD | NEW |