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