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

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

Issue 9121055: Add a source to V8 proxy resolver-initiated DNS requests, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Pass BoundNetLog around in unittest Created 8 years, 10 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/perftimer.h" 9 #include "base/perftimer.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "net/base/mock_host_resolver.h" 11 #include "net/base/mock_host_resolver.h"
12 #include "net/base/net_errors.h" 12 #include "net/base/net_errors.h"
13 #include "net/proxy/proxy_info.h" 13 #include "net/proxy/proxy_info.h"
14 #include "net/proxy/proxy_resolver_js_bindings.h" 14 #include "net/proxy/proxy_resolver_js_bindings.h"
15 #include "net/proxy/proxy_resolver_v8.h" 15 #include "net/proxy/proxy_resolver_v8.h"
16 #include "net/proxy/sync_host_resolver.h" 16 #include "net/proxy/sync_host_resolver.h"
17 #include "net/test/test_server.h" 17 #include "net/test/test_server.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 #if defined(OS_WIN) 20 #if defined(OS_WIN)
21 #include "net/proxy/proxy_resolver_winhttp.h" 21 #include "net/proxy/proxy_resolver_winhttp.h"
22 #elif defined(OS_MACOSX) 22 #elif defined(OS_MACOSX)
23 #include "net/proxy/proxy_resolver_mac.h" 23 #include "net/proxy/proxy_resolver_mac.h"
24 #endif 24 #endif
25 25
26 class MockSyncHostResolver : public net::SyncHostResolver { 26 class MockSyncHostResolver : public net::SyncHostResolver {
27 public: 27 public:
28 virtual int Resolve(const net::HostResolver::RequestInfo& info, 28 virtual int Resolve(const net::HostResolver::RequestInfo& info,
29 net::AddressList* addresses) OVERRIDE { 29 net::AddressList* addresses,
30 const net::BoundNetLog& net_log) OVERRIDE {
30 return net::ERR_NAME_NOT_RESOLVED; 31 return net::ERR_NAME_NOT_RESOLVED;
31 } 32 }
32 33
33 virtual void Shutdown() OVERRIDE {} 34 virtual void Shutdown() OVERRIDE {}
34 }; 35 };
35 36
36 // This class holds the URL to use for resolving, and the expected result. 37 // This class holds the URL to use for resolving, and the expected result.
37 // We track the expected result in order to make sure the performance 38 // We track the expected result in order to make sure the performance
38 // test is actually resolving URLs properly, otherwise the perf numbers 39 // test is actually resolving URLs properly, otherwise the perf numbers
39 // are meaningless :-) 40 // are meaningless :-)
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 TEST(ProxyResolverPerfTest, ProxyResolverV8) { 208 TEST(ProxyResolverPerfTest, ProxyResolverV8) {
208 net::ProxyResolverJSBindings* js_bindings = 209 net::ProxyResolverJSBindings* js_bindings =
209 net::ProxyResolverJSBindings::CreateDefault( 210 net::ProxyResolverJSBindings::CreateDefault(
210 new MockSyncHostResolver, NULL, NULL); 211 new MockSyncHostResolver, NULL, NULL);
211 212
212 net::ProxyResolverV8 resolver(js_bindings); 213 net::ProxyResolverV8 resolver(js_bindings);
213 PacPerfSuiteRunner runner(&resolver, "ProxyResolverV8"); 214 PacPerfSuiteRunner runner(&resolver, "ProxyResolverV8");
214 runner.RunAllTests(); 215 runner.RunAllTests();
215 } 216 }
216 217
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698