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

Side by Side Diff: net/proxy/multi_threaded_proxy_resolver_unittest.cc

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « net/ocsp/nss_ocsp.cc ('k') | net/socket/tcp_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 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 "net/proxy/multi_threaded_proxy_resolver.h" 5 #include "net/proxy/multi_threaded_proxy_resolver.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/threading/platform_thread.h"
10 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
11 #include "base/waitable_event.h" 12 #include "base/waitable_event.h"
12 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
13 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
14 #include "net/base/net_log.h" 15 #include "net/base/net_log.h"
15 #include "net/base/net_log_unittest.h" 16 #include "net/base/net_log_unittest.h"
16 #include "net/base/test_completion_callback.h" 17 #include "net/base/test_completion_callback.h"
17 #include "net/proxy/proxy_info.h" 18 #include "net/proxy/proxy_info.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 20
(...skipping 13 matching lines...) Expand all
33 purge_count_(0), 34 purge_count_(0),
34 resolve_latency_ms_(0) {} 35 resolve_latency_ms_(0) {}
35 36
36 // ProxyResolver implementation: 37 // ProxyResolver implementation:
37 virtual int GetProxyForURL(const GURL& query_url, 38 virtual int GetProxyForURL(const GURL& query_url,
38 ProxyInfo* results, 39 ProxyInfo* results,
39 CompletionCallback* callback, 40 CompletionCallback* callback,
40 RequestHandle* request, 41 RequestHandle* request,
41 const BoundNetLog& net_log) { 42 const BoundNetLog& net_log) {
42 if (resolve_latency_ms_) 43 if (resolve_latency_ms_)
43 PlatformThread::Sleep(resolve_latency_ms_); 44 base::PlatformThread::Sleep(resolve_latency_ms_);
44 45
45 CheckIsOnWorkerThread(); 46 CheckIsOnWorkerThread();
46 47
47 EXPECT_TRUE(callback == NULL); 48 EXPECT_TRUE(callback == NULL);
48 EXPECT_TRUE(request == NULL); 49 EXPECT_TRUE(request == NULL);
49 50
50 // Write something into |net_log| (doesn't really have any meaning.) 51 // Write something into |net_log| (doesn't really have any meaning.)
51 net_log.BeginEvent(NetLog::TYPE_PAC_JAVASCRIPT_DNS_RESOLVE, NULL); 52 net_log.BeginEvent(NetLog::TYPE_PAC_JAVASCRIPT_DNS_RESOLVE, NULL);
52 53
53 results->UseNamedProxy(query_url.host()); 54 results->UseNamedProxy(query_url.host());
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 // All in all, the first thread should have seen just 1 request. And the 767 // All in all, the first thread should have seen just 1 request. And the
767 // second thread 3 requests. 768 // second thread 3 requests.
768 ASSERT_EQ(2u, factory->resolvers().size()); 769 ASSERT_EQ(2u, factory->resolvers().size());
769 EXPECT_EQ(1, factory->resolvers()[0]->request_count()); 770 EXPECT_EQ(1, factory->resolvers()[0]->request_count());
770 EXPECT_EQ(3, factory->resolvers()[1]->request_count()); 771 EXPECT_EQ(3, factory->resolvers()[1]->request_count());
771 } 772 }
772 773
773 } // namespace 774 } // namespace
774 775
775 } // namespace net 776 } // namespace net
OLDNEW
« no previous file with comments | « net/ocsp/nss_ocsp.cc ('k') | net/socket/tcp_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698