diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 23:39:16 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 23:39:16 +0000 |
commit | 8412bbc1508c1966e66ae02ee70bdaf9329951de (patch) | |
tree | 00662dff907cc2899a64378da40380bb98e82fb2 /net/proxy/proxy_service_unittest.cc | |
parent | 04ec2cc698190721f2afe33325873e348d4882af (diff) | |
download | chromium_src-8412bbc1508c1966e66ae02ee70bdaf9329951de.zip chromium_src-8412bbc1508c1966e66ae02ee70bdaf9329951de.tar.gz chromium_src-8412bbc1508c1966e66ae02ee70bdaf9329951de.tar.bz2 |
Add a new event to LoadLog:
PROXY_SERVICE_POLL_CONFIG_SERVICE_FOR_CHANGES
which measures how much time was spent per request retrieving the system proxy settings.
On Windows this corresponds with the function:
WinHttpGetIEProxyConfigForCurrentUser().
Which seems to be very slow on some systems.
BUG=12189
Review URL: http://codereview.chromium.org/452034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service_unittest.cc')
-rw-r--r-- | net/proxy/proxy_service_unittest.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index 6dbee99..3422b5a 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -106,9 +106,9 @@ TEST(ProxyServiceTest, Direct) { EXPECT_TRUE(info.is_direct()); // Check the LoadLog was filled correctly. - EXPECT_EQ(2u, log->events().size()); + EXPECT_EQ(4u, log->events().size()); ExpectLogContains(log, 0, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_BEGIN); - ExpectLogContains(log, 1, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); + ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); } TEST(ProxyServiceTest, PAC) { @@ -145,13 +145,13 @@ TEST(ProxyServiceTest, PAC) { EXPECT_EQ("foopy:80", info.proxy_server().ToURI()); // Check the LoadLog was filled correctly. - EXPECT_EQ(4u, log->events().size()); + EXPECT_EQ(6u, log->events().size()); ExpectLogContains(log, 0, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_BEGIN); - ExpectLogContains(log, 1, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, + ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, LoadLog::PHASE_BEGIN); - ExpectLogContains(log, 2, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, + ExpectLogContains(log, 4, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, LoadLog::PHASE_END); - ExpectLogContains(log, 3, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); + ExpectLogContains(log, 5, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); } // Test that the proxy resolver does not see the URL's username/password @@ -1134,14 +1134,14 @@ TEST(ProxyServiceTest, CancelWhilePACFetching) { EXPECT_FALSE(callback2.have_result()); // Cancelled. // Check the LoadLog for request 1 (which was cancelled) got filled properly. - EXPECT_EQ(4u, log1->events().size()); + EXPECT_EQ(6u, log1->events().size()); ExpectLogContains(log1, 0, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_BEGIN); - ExpectLogContains(log1, 1, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, + ExpectLogContains(log1, 3, LoadLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC, LoadLog::PHASE_BEGIN); // Note that TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC is never completed before // the cancellation occured. - ExpectLogContains(log1, 2, LoadLog::TYPE_CANCELLED, LoadLog::PHASE_NONE); - ExpectLogContains(log1, 3, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); + ExpectLogContains(log1, 4, LoadLog::TYPE_CANCELLED, LoadLog::PHASE_NONE); + ExpectLogContains(log1, 5, LoadLog::TYPE_PROXY_SERVICE, LoadLog::PHASE_END); } // Test that if auto-detect fails, we fall-back to the custom pac. @@ -1517,7 +1517,7 @@ TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect) { // Force the ProxyService to pull down a new proxy configuration. // (Even though the configuration isn't old/bad). - service->UpdateConfig(); + service->UpdateConfig(NULL); // Start another request -- the effective configuration has not // changed, so we shouldn't re-run the autodetect step. @@ -1573,7 +1573,7 @@ TEST(ProxyServiceTest, UpdateConfigFromPACToDirect) { // requests should complete synchronously now as direct-connect. config.auto_detect = false; config_service->config = config; - service->UpdateConfig(); + service->UpdateConfig(NULL); // Start another request -- the effective configuration has changed. ProxyInfo info2; |