| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 net::MockAsyncProxyResolverFactory* resolver_factory_; | 85 net::MockAsyncProxyResolverFactory* resolver_factory_; |
| 86 net::MockAsyncProxyResolver resolver_; | 86 net::MockAsyncProxyResolver resolver_; |
| 87 scoped_ptr<net::ProxyService> service_; | 87 scoped_ptr<net::ProxyService> service_; |
| 88 scoped_refptr<ResolveProxyMsgHelper> helper_; | 88 scoped_refptr<ResolveProxyMsgHelper> helper_; |
| 89 scoped_ptr<PendingResult> pending_result_; | 89 scoped_ptr<PendingResult> pending_result_; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 bool OnMessageReceived(const IPC::Message& msg) override { | 92 bool OnMessageReceived(const IPC::Message& msg) override { |
| 93 base::TupleTypes<ViewHostMsg_ResolveProxy::ReplyParam>::ValueTuple | 93 ViewHostMsg_ResolveProxy::ReplyParam reply_data; |
| 94 reply_data; | |
| 95 EXPECT_TRUE(ViewHostMsg_ResolveProxy::ReadReplyParam(&msg, &reply_data)); | 94 EXPECT_TRUE(ViewHostMsg_ResolveProxy::ReadReplyParam(&msg, &reply_data)); |
| 96 DCHECK(!pending_result_.get()); | 95 DCHECK(!pending_result_.get()); |
| 97 pending_result_.reset( | 96 pending_result_.reset( |
| 98 new PendingResult(base::get<0>(reply_data), base::get<1>(reply_data))); | 97 new PendingResult(base::get<0>(reply_data), base::get<1>(reply_data))); |
| 99 test_sink_.ClearMessages(); | 98 test_sink_.ClearMessages(); |
| 100 return true; | 99 return true; |
| 101 } | 100 } |
| 102 | 101 |
| 103 base::MessageLoopForIO message_loop_; | 102 base::MessageLoopForIO message_loop_; |
| 104 BrowserThreadImpl io_thread_; | 103 BrowserThreadImpl io_thread_; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 256 |
| 258 EXPECT_EQ(0u, resolver_.pending_requests().size()); | 257 EXPECT_EQ(0u, resolver_.pending_requests().size()); |
| 259 | 258 |
| 260 EXPECT_TRUE(pending_result() == NULL); | 259 EXPECT_TRUE(pending_result() == NULL); |
| 261 | 260 |
| 262 // It should also be the case that msg1, msg2, msg3 were deleted by the | 261 // It should also be the case that msg1, msg2, msg3 were deleted by the |
| 263 // cancellation. (Else will show up as a leak in Valgrind). | 262 // cancellation. (Else will show up as a leak in Valgrind). |
| 264 } | 263 } |
| 265 | 264 |
| 266 } // namespace content | 265 } // namespace content |
| OLD | NEW |