OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/net/resolve_proxy_msg_helper.h" | 5 #include "chrome/browser/net/resolve_proxy_msg_helper.h" |
6 | 6 |
7 #include "base/waitable_event.h" | |
8 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
9 #include "net/proxy/mock_proxy_resolver.h" | 8 #include "net/proxy/mock_proxy_resolver.h" |
10 #include "net/proxy/proxy_config_service.h" | 9 #include "net/proxy/proxy_config_service.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 | 11 |
13 // This ProxyConfigService always returns "http://pac" as the PAC url to use. | 12 // This ProxyConfigService always returns "http://pac" as the PAC url to use. |
14 class MockProxyConfigService : public net::ProxyConfigService { | 13 class MockProxyConfigService : public net::ProxyConfigService { |
15 public: | 14 public: |
16 virtual void AddObserver(Observer* observer) {} | 15 virtual void AddObserver(Observer* observer) {} |
17 virtual void RemoveObserver(Observer* observer) {} | 16 virtual void RemoveObserver(Observer* observer) {} |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 224 |
226 // The pending requests sent to the proxy resolver should have been cancelled. | 225 // The pending requests sent to the proxy resolver should have been cancelled. |
227 | 226 |
228 EXPECT_EQ(0u, resolver->pending_requests().size()); | 227 EXPECT_EQ(0u, resolver->pending_requests().size()); |
229 | 228 |
230 EXPECT_TRUE(delegate.pending_result() == NULL); | 229 EXPECT_TRUE(delegate.pending_result() == NULL); |
231 | 230 |
232 // It should also be the case that msg1, msg2, msg3 were deleted by the | 231 // It should also be the case that msg1, msg2, msg3 were deleted by the |
233 // cancellation. (Else will show up as a leak in Purify/Valgrind). | 232 // cancellation. (Else will show up as a leak in Purify/Valgrind). |
234 } | 233 } |
OLD | NEW |