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

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

Issue 10534132: NetLogEventParameter to Callback refactoring 7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unneeded variable 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
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_list.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const BoundNetLog& net_log) OVERRIDE { 42 const BoundNetLog& net_log) OVERRIDE {
43 if (resolve_latency_ != base::TimeDelta()) 43 if (resolve_latency_ != base::TimeDelta())
44 base::PlatformThread::Sleep(resolve_latency_); 44 base::PlatformThread::Sleep(resolve_latency_);
45 45
46 CheckIsOnWorkerThread(); 46 CheckIsOnWorkerThread();
47 47
48 EXPECT_TRUE(callback.is_null()); 48 EXPECT_TRUE(callback.is_null());
49 EXPECT_TRUE(request == NULL); 49 EXPECT_TRUE(request == NULL);
50 50
51 // Write something into |net_log| (doesn't really have any meaning.) 51 // Write something into |net_log| (doesn't really have any meaning.)
52 net_log.BeginEvent(NetLog::TYPE_PAC_JAVASCRIPT_DNS_RESOLVE, NULL); 52 net_log.BeginEvent(NetLog::TYPE_PAC_JAVASCRIPT_DNS_RESOLVE);
53 53
54 results->UseNamedProxy(query_url.host()); 54 results->UseNamedProxy(query_url.host());
55 55
56 // Return a success code which represents the request's order. 56 // Return a success code which represents the request's order.
57 return request_count_++; 57 return request_count_++;
58 } 58 }
59 59
60 virtual void CancelRequest(RequestHandle request) OVERRIDE { 60 virtual void CancelRequest(RequestHandle request) OVERRIDE {
61 NOTREACHED(); 61 NOTREACHED();
62 } 62 }
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 // All in all, the first thread should have seen just 1 request. And the 789 // All in all, the first thread should have seen just 1 request. And the
790 // second thread 3 requests. 790 // second thread 3 requests.
791 ASSERT_EQ(2u, factory->resolvers().size()); 791 ASSERT_EQ(2u, factory->resolvers().size());
792 EXPECT_EQ(1, factory->resolvers()[0]->request_count()); 792 EXPECT_EQ(1, factory->resolvers()[0]->request_count());
793 EXPECT_EQ(3, factory->resolvers()[1]->request_count()); 793 EXPECT_EQ(3, factory->resolvers()[1]->request_count());
794 } 794 }
795 795
796 } // namespace 796 } // namespace
797 797
798 } // namespace net 798 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver.cc ('k') | net/proxy/proxy_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698