| OLD | NEW |
| 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/proxy_service.h" | 5 #include "net/proxy/proxy_service.h" |
| 6 | 6 |
| 7 #include <cstdarg> | 7 #include <cstdarg> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2081 | 2081 |
| 2082 jobs[url3]->results()->UseNamedProxy("request3:80"); | 2082 jobs[url3]->results()->UseNamedProxy("request3:80"); |
| 2083 jobs[url3]->CompleteNow(OK); | 2083 jobs[url3]->CompleteNow(OK); |
| 2084 | 2084 |
| 2085 jobs[url1]->results()->UseNamedProxy("request1:80"); | 2085 jobs[url1]->results()->UseNamedProxy("request1:80"); |
| 2086 jobs[url1]->CompleteNow(OK); | 2086 jobs[url1]->CompleteNow(OK); |
| 2087 | 2087 |
| 2088 jobs[url2]->results()->UseNamedProxy("request2:80"); | 2088 jobs[url2]->results()->UseNamedProxy("request2:80"); |
| 2089 jobs[url2]->CompleteNow(OK); | 2089 jobs[url2]->CompleteNow(OK); |
| 2090 | 2090 |
| 2091 //<<<<<<< HEAD | |
| 2092 // // Complete and verify that requests ran as expected. | |
| 2093 // EXPECT_THAT(callback1.WaitForResult(), IsOk()); | |
| 2094 //======= | |
| 2095 // Complete and verify that jobs ran as expected. | 2091 // Complete and verify that jobs ran as expected. |
| 2096 EXPECT_EQ(OK, callback1.WaitForResult()); | 2092 EXPECT_EQ(OK, callback1.WaitForResult()); |
| 2097 //>>>>>>> parent of 9c8f424... Revert of Change | |
| 2098 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather | 2093 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather |
| 2099 // than a RequestHandle* (patchset #11 id:200001 of | 2094 // than a RequestHandle* (patchset #11 id:200001 of |
| 2100 // https://codereview.chromium.org/1439053002/ ) | 2095 // https://codereview.chromium.org/1439053002/ ) |
| 2101 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); | 2096 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); |
| 2102 EXPECT_FALSE(info1.proxy_resolve_start_time().is_null()); | 2097 EXPECT_FALSE(info1.proxy_resolve_start_time().is_null()); |
| 2103 EXPECT_FALSE(info1.proxy_resolve_end_time().is_null()); | 2098 EXPECT_FALSE(info1.proxy_resolve_end_time().is_null()); |
| 2104 EXPECT_LE(info1.proxy_resolve_start_time(), info1.proxy_resolve_end_time()); | 2099 EXPECT_LE(info1.proxy_resolve_start_time(), info1.proxy_resolve_end_time()); |
| 2105 | 2100 |
| 2106 EXPECT_THAT(callback2.WaitForResult(), IsOk()); | 2101 EXPECT_THAT(callback2.WaitForResult(), IsOk()); |
| 2107 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); | 2102 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 // (which was initialized with custom PAC script). | 2325 // (which was initialized with custom PAC script). |
| 2331 | 2326 |
| 2332 JobMap jobs = GetPendingJobsForURLs(resolver, url1, url2); | 2327 JobMap jobs = GetPendingJobsForURLs(resolver, url1, url2); |
| 2333 | 2328 |
| 2334 // Complete the pending jobs. | 2329 // Complete the pending jobs. |
| 2335 jobs[url2]->results()->UseNamedProxy("request2:80"); | 2330 jobs[url2]->results()->UseNamedProxy("request2:80"); |
| 2336 jobs[url2]->CompleteNow(OK); | 2331 jobs[url2]->CompleteNow(OK); |
| 2337 jobs[url1]->results()->UseNamedProxy("request1:80"); | 2332 jobs[url1]->results()->UseNamedProxy("request1:80"); |
| 2338 jobs[url1]->CompleteNow(OK); | 2333 jobs[url1]->CompleteNow(OK); |
| 2339 | 2334 |
| 2340 //<<<<<<< HEAD | |
| 2341 // // Verify that requests ran as expected. | |
| 2342 // EXPECT_THAT(callback1.WaitForResult(), IsOk()); | |
| 2343 //======= | |
| 2344 // Verify that jobs ran as expected. | 2335 // Verify that jobs ran as expected. |
| 2345 EXPECT_EQ(OK, callback1.WaitForResult()); | 2336 EXPECT_EQ(OK, callback1.WaitForResult()); |
| 2346 //>>>>>>> parent of 9c8f424... Revert of Change | |
| 2347 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather | 2337 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather |
| 2348 // than a RequestHandle* (patchset #11 id:200001 of | 2338 // than a RequestHandle* (patchset #11 id:200001 of |
| 2349 // https://codereview.chromium.org/1439053002/ ) | 2339 // https://codereview.chromium.org/1439053002/ ) |
| 2350 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); | 2340 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); |
| 2351 EXPECT_FALSE(info1.proxy_resolve_start_time().is_null()); | 2341 EXPECT_FALSE(info1.proxy_resolve_start_time().is_null()); |
| 2352 EXPECT_FALSE(info1.proxy_resolve_end_time().is_null()); | 2342 EXPECT_FALSE(info1.proxy_resolve_end_time().is_null()); |
| 2353 EXPECT_LE(info1.proxy_resolve_start_time(), info1.proxy_resolve_end_time()); | 2343 EXPECT_LE(info1.proxy_resolve_start_time(), info1.proxy_resolve_end_time()); |
| 2354 | 2344 |
| 2355 EXPECT_THAT(callback2.WaitForResult(), IsOk()); | 2345 EXPECT_THAT(callback2.WaitForResult(), IsOk()); |
| 2356 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); | 2346 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 // (which was initialized with custom PAC script). | 2410 // (which was initialized with custom PAC script). |
| 2421 | 2411 |
| 2422 JobMap jobs = GetPendingJobsForURLs(resolver, url1, url2); | 2412 JobMap jobs = GetPendingJobsForURLs(resolver, url1, url2); |
| 2423 | 2413 |
| 2424 // Complete the pending jobs. | 2414 // Complete the pending jobs. |
| 2425 jobs[url2]->results()->UseNamedProxy("request2:80"); | 2415 jobs[url2]->results()->UseNamedProxy("request2:80"); |
| 2426 jobs[url2]->CompleteNow(OK); | 2416 jobs[url2]->CompleteNow(OK); |
| 2427 jobs[url1]->results()->UseNamedProxy("request1:80"); | 2417 jobs[url1]->results()->UseNamedProxy("request1:80"); |
| 2428 jobs[url1]->CompleteNow(OK); | 2418 jobs[url1]->CompleteNow(OK); |
| 2429 | 2419 |
| 2430 //<<<<<<< HEAD | |
| 2431 // // Verify that requests ran as expected. | |
| 2432 // EXPECT_THAT(callback1.WaitForResult(), IsOk()); | |
| 2433 //======= | |
| 2434 // Verify that jobs ran as expected. | 2420 // Verify that jobs ran as expected. |
| 2435 EXPECT_EQ(OK, callback1.WaitForResult()); | 2421 EXPECT_EQ(OK, callback1.WaitForResult()); |
| 2436 //>>>>>>> parent of 9c8f424... Revert of Change | |
| 2437 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather | 2422 // ProxyResolver::GetProxyForURL() to take a std::unique_ptr<Request>* rather |
| 2438 // than a RequestHandle* (patchset #11 id:200001 of | 2423 // than a RequestHandle* (patchset #11 id:200001 of |
| 2439 // https://codereview.chromium.org/1439053002/ ) | 2424 // https://codereview.chromium.org/1439053002/ ) |
| 2440 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); | 2425 EXPECT_EQ("request1:80", info1.proxy_server().ToURI()); |
| 2441 | 2426 |
| 2442 EXPECT_THAT(callback2.WaitForResult(), IsOk()); | 2427 EXPECT_THAT(callback2.WaitForResult(), IsOk()); |
| 2443 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); | 2428 EXPECT_EQ("request2:80", info2.proxy_server().ToURI()); |
| 2444 } | 2429 } |
| 2445 | 2430 |
| 2446 // Test that if all of auto-detect, a custom PAC script, and manual settings | 2431 // Test that if all of auto-detect, a custom PAC script, and manual settings |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3694 GURL(test.sanitized_url_unstripped), | 3679 GURL(test.sanitized_url_unstripped), |
| 3695 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE)); | 3680 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE)); |
| 3696 | 3681 |
| 3697 EXPECT_EQ( | 3682 EXPECT_EQ( |
| 3698 GURL(test.sanitized_url), | 3683 GURL(test.sanitized_url), |
| 3699 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE)); | 3684 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE)); |
| 3700 } | 3685 } |
| 3701 } | 3686 } |
| 3702 | 3687 |
| 3703 } // namespace net | 3688 } // namespace net |
| OLD | NEW |