| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/waitable_event.h" | 5 #include "base/waitable_event.h" |
| 6 #include "googleurl/src/gurl.h" | 6 #include "googleurl/src/gurl.h" |
| 7 #include "net/base/load_log.h" | 7 #include "net/base/load_log.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
| 10 #include "net/proxy/proxy_info.h" | 10 #include "net/proxy/proxy_info.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual int GetProxyForURL(const GURL& query_url, | 29 virtual int GetProxyForURL(const GURL& query_url, |
| 30 ProxyInfo* results, | 30 ProxyInfo* results, |
| 31 CompletionCallback* callback, | 31 CompletionCallback* callback, |
| 32 RequestHandle* request, | 32 RequestHandle* request, |
| 33 LoadLog* load_log) { | 33 LoadLog* load_log) { |
| 34 if (resolve_latency_ms_) | 34 if (resolve_latency_ms_) |
| 35 PlatformThread::Sleep(resolve_latency_ms_); | 35 PlatformThread::Sleep(resolve_latency_ms_); |
| 36 | 36 |
| 37 CheckIsOnWorkerThread(); | 37 CheckIsOnWorkerThread(); |
| 38 | 38 |
| 39 EXPECT_EQ(NULL, callback); | 39 EXPECT_TRUE(callback == NULL); |
| 40 EXPECT_EQ(NULL, request); | 40 EXPECT_TRUE(request == NULL); |
| 41 | 41 |
| 42 // Write something into |load_log| (doesn't really have any meaning.) | 42 // Write something into |load_log| (doesn't really have any meaning.) |
| 43 LoadLog::BeginEvent(load_log, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE); | 43 LoadLog::BeginEvent(load_log, LoadLog::TYPE_PROXY_RESOLVER_V8_DNS_RESOLVE); |
| 44 | 44 |
| 45 results->UseNamedProxy(query_url.host()); | 45 results->UseNamedProxy(query_url.host()); |
| 46 | 46 |
| 47 // Return a success code which represents the request's order. | 47 // Return a success code which represents the request's order. |
| 48 return request_count_++; | 48 return request_count_++; |
| 49 } | 49 } |
| 50 | 50 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 rv = callback1.WaitForResult(); | 372 rv = callback1.WaitForResult(); |
| 373 EXPECT_EQ(1, rv); | 373 EXPECT_EQ(1, rv); |
| 374 EXPECT_EQ("PROXY request1:80", results1.ToPacString()); | 374 EXPECT_EQ("PROXY request1:80", results1.ToPacString()); |
| 375 | 375 |
| 376 // The SetPacScript callback should never have been completed. | 376 // The SetPacScript callback should never have been completed. |
| 377 EXPECT_FALSE(set_pac_script_callback.have_result()); | 377 EXPECT_FALSE(set_pac_script_callback.have_result()); |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace | 380 } // namespace |
| 381 } // namespace net | 381 } // namespace net |
| OLD | NEW |