| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : result(result), proxy_list(proxy_list) { | 54 : result(result), proxy_list(proxy_list) { |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool result; | 57 bool result; |
| 58 std::string proxy_list; | 58 std::string proxy_list; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 ResolveProxyMsgHelperTest() | 61 ResolveProxyMsgHelperTest() |
| 62 : resolver_(new net::MockAsyncProxyResolver), | 62 : resolver_(new net::MockAsyncProxyResolver), |
| 63 service_( | 63 service_( |
| 64 new net::ProxyService(new MockProxyConfigService, resolver_, NULL)), | 64 new net::ProxyService( |
| 65 new MockProxyConfigService, resolver_, NULL, 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 248 |
| 248 EXPECT_EQ(0u, resolver_->pending_requests().size()); | 249 EXPECT_EQ(0u, resolver_->pending_requests().size()); |
| 249 | 250 |
| 250 EXPECT_TRUE(pending_result() == NULL); | 251 EXPECT_TRUE(pending_result() == NULL); |
| 251 | 252 |
| 252 // It should also be the case that msg1, msg2, msg3 were deleted by the | 253 // It should also be the case that msg1, msg2, msg3 were deleted by the |
| 253 // cancellation. (Else will show up as a leak in Valgrind). | 254 // cancellation. (Else will show up as a leak in Valgrind). |
| 254 } | 255 } |
| 255 | 256 |
| 256 } // namespace content | 257 } // namespace content |
| OLD | NEW |