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

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

Issue 23985006: base: Split logging functions and PerfTimeLogger out of perftimer.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix visitedlink Created 7 years, 3 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/disk_cache/disk_cache_perftest.cc ('k') | ppapi/proxy/ppp_messaging_proxy_perftest.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 "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/test/perftimer.h" 10 #include "base/test/perf_time_logger.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 #include "net/dns/mock_host_resolver.h" 12 #include "net/dns/mock_host_resolver.h"
13 #include "net/proxy/proxy_info.h" 13 #include "net/proxy/proxy_info.h"
14 #include "net/proxy/proxy_resolver_v8.h" 14 #include "net/proxy/proxy_resolver_v8.h"
15 #include "net/test/spawned_test_server/spawned_test_server.h" 15 #include "net/test/spawned_test_server/spawned_test_server.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 #if defined(OS_WIN) 18 #if defined(OS_WIN)
19 #include "net/proxy/proxy_resolver_winhttp.h" 19 #include "net/proxy/proxy_resolver_winhttp.h"
20 #elif defined(OS_MACOSX) 20 #elif defined(OS_MACOSX)
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 { 123 {
124 net::ProxyInfo proxy_info; 124 net::ProxyInfo proxy_info;
125 int result = resolver_->GetProxyForURL( 125 int result = resolver_->GetProxyForURL(
126 GURL("http://www.warmup.com"), &proxy_info, net::CompletionCallback(), 126 GURL("http://www.warmup.com"), &proxy_info, net::CompletionCallback(),
127 NULL, net::BoundNetLog()); 127 NULL, net::BoundNetLog());
128 ASSERT_EQ(net::OK, result); 128 ASSERT_EQ(net::OK, result);
129 } 129 }
130 130
131 // Start the perf timer. 131 // Start the perf timer.
132 std::string perf_test_name = resolver_name_ + "_" + script_name; 132 std::string perf_test_name = resolver_name_ + "_" + script_name;
133 PerfTimeLogger timer(perf_test_name.c_str()); 133 base::PerfTimeLogger timer(perf_test_name.c_str());
134 134
135 for (int i = 0; i < kNumIterations; ++i) { 135 for (int i = 0; i < kNumIterations; ++i) {
136 // Round-robin between URLs to resolve. 136 // Round-robin between URLs to resolve.
137 const PacQuery& query = queries[i % queries_len]; 137 const PacQuery& query = queries[i % queries_len];
138 138
139 // Resolve. 139 // Resolve.
140 net::ProxyInfo proxy_info; 140 net::ProxyInfo proxy_info;
141 int result = resolver_->GetProxyForURL( 141 int result = resolver_->GetProxyForURL(
142 GURL(query.query_url), &proxy_info, net::CompletionCallback(), NULL, 142 GURL(query.query_url), &proxy_info, net::CompletionCallback(), NULL,
143 net::BoundNetLog()); 143 net::BoundNetLog());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 TEST(ProxyResolverPerfTest, ProxyResolverV8) { 220 TEST(ProxyResolverPerfTest, ProxyResolverV8) {
221 // This has to be done on the main thread. 221 // This has to be done on the main thread.
222 net::ProxyResolverV8::RememberDefaultIsolate(); 222 net::ProxyResolverV8::RememberDefaultIsolate();
223 223
224 MockJSBindings js_bindings; 224 MockJSBindings js_bindings;
225 net::ProxyResolverV8 resolver; 225 net::ProxyResolverV8 resolver;
226 resolver.set_js_bindings(&js_bindings); 226 resolver.set_js_bindings(&js_bindings);
227 PacPerfSuiteRunner runner(&resolver, "ProxyResolverV8"); 227 PacPerfSuiteRunner runner(&resolver, "ProxyResolverV8");
228 runner.RunAllTests(); 228 runner.RunAllTests();
229 } 229 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_perftest.cc ('k') | ppapi/proxy/ppp_messaging_proxy_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698