Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: content/browser/resolve_proxy_msg_helper_unittest.cc

Issue 10662005: Use IPC::Sender and IPC::Listener in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 using content::BrowserThread;
17 using content::BrowserThreadImpl; 17 using content::BrowserThreadImpl;
18 18
19 // This ProxyConfigService always returns "http://pac" as the PAC url to use. 19 // This ProxyConfigService always returns "http://pac" as the PAC url to use.
20 class MockProxyConfigService : public net::ProxyConfigService { 20 class MockProxyConfigService : public net::ProxyConfigService {
21 public: 21 public:
22 virtual void AddObserver(Observer* observer) {} 22 virtual void AddObserver(Observer* observer) {}
23 virtual void RemoveObserver(Observer* observer) {} 23 virtual void RemoveObserver(Observer* observer) {}
24 virtual ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* results) { 24 virtual ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* results) {
25 *results = net::ProxyConfig::CreateFromCustomPacURL(GURL("http://pac")); 25 *results = net::ProxyConfig::CreateFromCustomPacURL(GURL("http://pac"));
26 return CONFIG_VALID; 26 return CONFIG_VALID;
27 } 27 }
28 }; 28 };
29 29
30 class ResolveProxyMsgHelperTest : public testing::Test, 30 class ResolveProxyMsgHelperTest : public testing::Test, public IPC::Listener {
31 public IPC::Channel::Listener {
32 public: 31 public:
33 struct PendingResult { 32 struct PendingResult {
34 PendingResult(bool result, 33 PendingResult(bool result,
35 const std::string& proxy_list) 34 const std::string& proxy_list)
36 : result(result), proxy_list(proxy_list) { 35 : result(result), proxy_list(proxy_list) {
37 } 36 }
38 37
39 bool result; 38 bool result;
40 std::string proxy_list; 39 std::string proxy_list;
41 }; 40 };
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 228
230 // The pending requests sent to the proxy resolver should have been cancelled. 229 // The pending requests sent to the proxy resolver should have been cancelled.
231 230
232 EXPECT_EQ(0u, resolver_->pending_requests().size()); 231 EXPECT_EQ(0u, resolver_->pending_requests().size());
233 232
234 EXPECT_TRUE(pending_result() == NULL); 233 EXPECT_TRUE(pending_result() == NULL);
235 234
236 // It should also be the case that msg1, msg2, msg3 were deleted by the 235 // It should also be the case that msg1, msg2, msg3 were deleted by the
237 // cancellation. (Else will show up as a leak in Valgrind). 236 // cancellation. (Else will show up as a leak in Valgrind).
238 } 237 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_unittest.cc ('k') | content/browser/webui/web_ui_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698