Lines Matching full:resolver
118 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
121 ProxyConfig::CreateDirect()), resolver, NULL));
130 EXPECT_TRUE(resolver->pending_requests().empty());
152 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
155 new ProxyService(config_service, resolver, NULL));
167 resolver->pending_set_pac_script_request()->script_data()->url());
168 resolver->pending_set_pac_script_request()->CompleteNow(OK);
170 ASSERT_EQ(1u, resolver->pending_requests().size());
171 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
173 // Set the result in proxy resolver.
174 resolver->pending_requests()[0]->results()->UseNamedProxy("foopy");
175 resolver->pending_requests()[0]->CompleteNow(OK);
196 // Test that the proxy resolver does not see the URL's username/password
202 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
205 new ProxyService(config_service, resolver, NULL));
215 resolver->pending_set_pac_script_request()->script_data()->url());
216 resolver->pending_set_pac_script_request()->CompleteNow(OK);
218 ASSERT_EQ(1u, resolver->pending_requests().size());
221 resolver->pending_requests()[0]->url());
230 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
233 new ProxyService(config_service, resolver, NULL));
243 resolver->pending_set_pac_script_request()->script_data()->url());
244 resolver->pending_set_pac_script_request()->CompleteNow(OK);
246 ASSERT_EQ(1u, resolver->pending_requests().size());
247 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
249 // Set the result in proxy resolver.
250 resolver->pending_requests()[0]->results()->UseNamedProxy("foopy:8080");
251 resolver->pending_requests()[0]->CompleteNow(OK);
288 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
291 new ProxyService(config_service, resolver, NULL));
301 resolver->pending_set_pac_script_request()->script_data()->url());
302 resolver->pending_set_pac_script_request()->CompleteNow(OK);
304 ASSERT_EQ(1u, resolver->pending_requests().size());
305 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
307 // Set the result in proxy resolver.
308 resolver->pending_requests()[0]->results()->UsePacString(
310 resolver->pending_requests()[0]->CompleteNow(OK);
354 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
357 new ProxyService(config_service, resolver, NULL));
367 resolver->pending_set_pac_script_request()->script_data()->url());
368 resolver->pending_set_pac_script_request()->CompleteNow(OK);
370 ASSERT_EQ(1u, resolver->pending_requests().size());
371 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
374 resolver->pending_requests()[0]->CompleteNow(ERR_FAILED);
376 // Although the proxy resolver failed the request, ProxyService implicitly
381 // The second resolve request will try to run through the proxy resolver,
387 ASSERT_EQ(1u, resolver->pending_requests().size());
388 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
390 // This time we will have the resolver succeed (perhaps the PAC script has
392 resolver->pending_requests()[0]->results()->UseNamedProxy("foopy_valid:8080");
393 resolver->pending_requests()[0]->CompleteNow(OK);
407 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
410 new ProxyService(config_service, resolver, NULL));
421 resolver->pending_set_pac_script_request()->script_data()->url());
422 resolver->pending_set_pac_script_request()->CompleteNow(OK);
424 ASSERT_EQ(1u, resolver->pending_requests().size());
425 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
427 // Set the result in proxy resolver.
428 resolver->pending_requests()[0]->results()->UseNamedProxy(
430 resolver->pending_requests()[0]->CompleteNow(OK);
450 ASSERT_EQ(1u, resolver->pending_requests().size());
451 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
453 // Set the result in proxy resolver -- the second result is already known
455 resolver->pending_requests()[0]->results()->UseNamedProxy(
457 resolver->pending_requests()[0]->CompleteNow(OK);
497 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
500 new ProxyService(config_service, resolver, NULL));
511 resolver->pending_set_pac_script_request()->script_data()->url());
512 resolver->pending_set_pac_script_request()->CompleteNow(OK);
514 ASSERT_EQ(1u, resolver->pending_requests().size());
515 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
517 // Set the result in proxy resolver.
518 resolver->pending_requests()[0]->results()->UsePacString(
520 resolver->pending_requests()[0]->CompleteNow(OK);
560 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
563 new ProxyService(config_service, resolver, NULL));
574 resolver->pending_set_pac_script_request()->script_data()->url());
575 resolver->pending_set_pac_script_request()->CompleteNow(OK);
577 ASSERT_EQ(1u, resolver->pending_requests().size());
578 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
580 // Set the result in proxy resolver.
581 resolver->pending_requests()[0]->results()->UseNamedProxy(
583 resolver->pending_requests()[0]->CompleteNow(OK);
600 resolver->pending_set_pac_script_request()->script_data()->url());
601 resolver->pending_set_pac_script_request()->CompleteNow(OK);
603 ASSERT_EQ(1u, resolver->pending_requests().size());
604 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
606 resolver->pending_requests()[0]->results()->UseNamedProxy(
608 resolver->pending_requests()[0]->CompleteNow(OK);
633 resolver->pending_set_pac_script_request()->script_data()->url());
634 resolver->pending_set_pac_script_request()->CompleteNow(OK);
636 ASSERT_EQ(1u, resolver->pending_requests().size());
637 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
639 resolver->pending_requests()[0]->results()->UseNamedProxy(
641 resolver->pending_requests()[0]->CompleteNow(OK);
653 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
656 new ProxyService(config_service, resolver, NULL));
667 resolver->pending_set_pac_script_request()->script_data()->url());
668 resolver->pending_set_pac_script_request()->CompleteNow(OK);
669 ASSERT_EQ(1u, resolver->pending_requests().size());
670 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
672 resolver->pending_requests()[0]->results()->UseNamedProxy(
674 resolver->pending_requests()[0]->CompleteNow(OK);
697 ASSERT_EQ(1u, resolver->pending_requests().size());
698 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
701 resolver->pending_requests()[0]->CompleteNow(ERR_FAILED);
703 // Although the resolver failed, the ProxyService will implicitly fall-back
718 ASSERT_EQ(1u, resolver->pending_requests().size());
719 EXPECT_EQ(url, resolver->pending_requests()[0]->url());
721 resolver->pending_requests()[0]->results()->UseNamedProxy(
723 resolver->pending_requests()[0]->CompleteNow(OK);
880 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
883 new ProxyService(config_service, resolver, NULL));
893 // Nothing has been sent to the proxy resolver yet, since the proxy
894 // resolver has not been configured yet.
895 ASSERT_EQ(0u, resolver->pending_requests().size());
899 resolver->pending_set_pac_script_request()->script_data()->url());
900 resolver->pending_set_pac_script_request()->CompleteNow(OK);
902 ASSERT_EQ(1u, resolver->pending_requests().size());
903 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
911 ASSERT_EQ(2u, resolver->pending_requests().size());
912 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
919 ASSERT_EQ(3u, resolver->pending_requests().size());
920 EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[2]->url());
925 ASSERT_EQ(2u, resolver->pending_requests().size());
926 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
927 EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[1]->url());
931 resolver->pending_requests()[1]->results()->UseNamedProxy("request3:80");
932 resolver->pending_requests()[1]->CompleteNow(OK);
934 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
935 resolver->pending_requests()[0]->CompleteNow(OK);
942 ASSERT_EQ(1u, resolver->cancelled_requests().size());
943 EXPECT_EQ(GURL("http://request2"), resolver->cancelled_requests()[0]->url());
949 // Test the initial PAC download for resolver that expects bytes.
954 MockAsyncProxyResolverExpectsBytes* resolver =
958 new ProxyService(config_service, resolver, NULL));
987 // Nothing has been sent to the resolver yet.
988 EXPECT_TRUE(resolver->pending_requests().empty());
996 // resolver.
998 resolver->pending_set_pac_script_request()->script_data()->utf16());
999 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1001 ASSERT_EQ(3u, resolver->pending_requests().size());
1002 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
1003 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
1004 EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[2]->url());
1009 resolver->pending_requests()[2]->results()->UseNamedProxy("request3:80");
1010 resolver->pending_requests()[2]->CompleteNow(OK);
1012 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1013 resolver->pending_requests()[0]->CompleteNow(OK);
1015 resolver->pending_requests()[0]->results()->UseNamedProxy("request2:80");
1016 resolver->pending_requests()[0]->CompleteNow(OK);
1034 MockAsyncProxyResolverExpectsBytes* resolver =
1038 new ProxyService(config_service, resolver, NULL));
1071 // Nothing has been sent to the resolver yet.
1072 EXPECT_TRUE(resolver->pending_requests().empty());
1077 // resolver.
1079 resolver->pending_set_pac_script_request()->script_data()->utf16());
1080 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1082 ASSERT_EQ(2u, resolver->pending_requests().size());
1083 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
1084 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
1092 MockAsyncProxyResolverExpectsBytes* resolver =
1096 new ProxyService(config_service, resolver, NULL));
1127 // Nothing has been sent to the resolver yet.
1128 EXPECT_TRUE(resolver->pending_requests().empty());
1140 // proxy resolver.
1142 resolver->pending_set_pac_script_request()->script_data()->utf16());
1143 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1145 ASSERT_EQ(1u, resolver->pending_requests().size());
1146 EXPECT_EQ(GURL("http://request3"), resolver->pending_requests()[0]->url());
1149 resolver->pending_requests()[0]->results()->UseNamedProxy("request3:80");
1150 resolver->pending_requests()[0]->CompleteNow(OK);
1155 EXPECT_TRUE(resolver->cancelled_requests().empty());
1185 MockAsyncProxyResolverExpectsBytes* resolver =
1188 new ProxyService(config_service, resolver, NULL));
1208 // Check that nothing has been sent to the proxy resolver yet.
1209 ASSERT_EQ(0u, resolver->pending_requests().size());
1223 resolver->pending_set_pac_script_request()->script_data()->utf16());
1224 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1226 // Now finally, the pending requests should have been sent to the resolver
1229 ASSERT_EQ(2u, resolver->pending_requests().size());
1230 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
1231 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
1234 resolver->pending_requests()[1]->results()->UseNamedProxy("request2:80");
1235 resolver->pending_requests()[1]->CompleteNow(OK);
1236 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1237 resolver->pending_requests()[0]->CompleteNow(OK);
1256 MockAsyncProxyResolverExpectsBytes* resolver =
1259 new ProxyService(config_service, resolver, NULL));
1279 // Check that nothing has been sent to the proxy resolver yet.
1280 ASSERT_EQ(0u, resolver->pending_requests().size());
1289 resolver->pending_set_pac_script_request()->script_data()->utf16());
1290 resolver->pending_set_pac_script_request()->CompleteNow(
1299 resolver->pending_set_pac_script_request()->script_data()->utf16());
1300 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1302 // Now finally, the pending requests should have been sent to the resolver
1305 ASSERT_EQ(2u, resolver->pending_requests().size());
1306 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
1307 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[1]->url());
1310 resolver
1311 resolver->pending_requests()[1]->CompleteNow(OK);
1312 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1313 resolver->pending_requests()[0]->CompleteNow(OK);
1332 MockAsyncProxyResolverExpectsBytes* resolver =
1335 new ProxyService(config_service, resolver, NULL));
1355 // Check that nothing has been sent to the proxy resolver yet.
1356 ASSERT_EQ(0u, resolver->pending_requests().size());
1370 ASSERT_EQ(0u, resolver->pending_requests().size());
1390 MockAsyncProxyResolverExpectsBytes* resolver =
1393 new ProxyService(config_service, resolver, NULL));
1406 // Check that nothing has been sent to the proxy resolver yet.
1407 ASSERT_EQ(0u, resolver->pending_requests().size());
1415 resolver->pending_set_pac_script_request()->script_data()->utf16());
1416 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1418 ASSERT_EQ(1u, resolver->pending_requests().size());
1420 resolver->pending_requests()[0]->url());
1423 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1424 resolver->pending_requests()[0]->CompleteNow(OK);
1437 ASSERT_EQ(1u, resolver->pending_requests().size());
1439 resolver->pending_requests()[0]->url());
1442 resolver->pending_requests()[0]->results()->UseNamedProxy("request2:80");
1443 resolver->pending_requests()[0]->CompleteNow(OK);
1458 MockAsyncProxyResolverExpectsBytes* resolver =
1461 new ProxyService(config_service, resolver, NULL));
1474 // Check that nothing has been sent to the proxy resolver yet.
1475 ASSERT_EQ(0u, resolver->pending_requests().size());
1487 // request to the proxy resolver. When run under valgrind, should not
1494 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
1497 new ProxyService(config_service, resolver, NULL));
1507 resolver->pending_set_pac_script_request()->script_data()->url());
1545 MockAsyncProxyResolver* resolver = new MockAsyncProxyResolver;
1547 new ProxyService(config_service, resolver, NULL));
1557 // Check that nothing has been sent to the proxy resolver yet.
1558 ASSERT_EQ(0u, resolver->pending_requests().size());
1562 resolver->pending_set_pac_script_request()->script_data()->type());
1563 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1566 ASSERT_EQ(1u, resolver->pending_requests().size());
1567 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1568 resolver->pending_requests()[0]->CompleteNow(OK);
1595 MockAsyncProxyResolverExpectsBytes* resolver =
1601 new ProxyService(config_service, resolver, &log));
1622 // Nothing has been sent to the resolver yet.
1623 EXPECT_TRUE(resolver->pending_requests().empty());
1631 // the proxy resolver.
1633 resolver->pending_set_pac_script_request()->script_data()->utf16());
1634 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1636 ASSERT_EQ(1u, resolver->pending_requests().size());
1637 EXPECT_EQ(GURL("http://request1"), resolver->pending_requests()[0]->url());
1640 resolver->pending_requests()[0]->results()->UseNamedProxy("request1:80");
1641 resolver->pending_requests()[0]->CompleteNow(OK);
1665 // Nothing has been sent to the resolver yet.
1666 EXPECT_TRUE(resolver->pending_requests().empty());
1673 // sent to the proxy resolver.
1675 resolver->pending_set_pac_script_request()->script_data()->utf16());
1676 resolver->pending_set_pac_script_request()->CompleteNow(OK);
1678 ASSERT_EQ(1u, resolver->pending_requests().size());
1679 EXPECT_EQ(GURL("http://request2"), resolver->pending_requests()[0]->url());
1682 resolver->pending_requests()[0]->results()->UseNamedProxy("request2:80");
1683 resolver->pending_requests()[0]->CompleteNow(OK);