| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/http/http_stream_factory_impl_job_controller.h" | 5 #include "net/http/http_stream_factory_impl_job_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 session_deps_.proxy_service.reset(new ProxyService( | 254 session_deps_.proxy_service.reset(new ProxyService( |
| 255 base::WrapUnique(new ProxyConfigServiceFixed(proxy_config)), | 255 base::WrapUnique(new ProxyConfigServiceFixed(proxy_config)), |
| 256 base::WrapUnique(proxy_resolver_factory), nullptr)); | 256 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 257 Initialize(false); | 257 Initialize(false); |
| 258 | 258 |
| 259 HttpRequestInfo request_info; | 259 HttpRequestInfo request_info; |
| 260 request_info.method = "GET"; | 260 request_info.method = "GET"; |
| 261 request_info.url = GURL("https://www.google.com"); | 261 request_info.url = GURL("https://www.google.com"); |
| 262 | 262 |
| 263 url::SchemeHostPort server(request_info.url); | 263 url::SchemeHostPort server(request_info.url); |
| 264 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 264 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 265 SetAlternativeService(request_info, alternative_service); | 265 SetAlternativeService(request_info, alternative_service); |
| 266 | 266 |
| 267 request_.reset( | 267 request_.reset( |
| 268 job_controller_->Start(request_info, &request_delegate_, nullptr, | 268 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 269 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 269 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 270 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 270 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 271 EXPECT_TRUE(job_controller_->main_job()); | 271 EXPECT_TRUE(job_controller_->main_job()); |
| 272 EXPECT_TRUE(job_controller_->alternative_job()); | 272 EXPECT_TRUE(job_controller_->alternative_job()); |
| 273 | 273 |
| 274 // Reset the Request will cancel all the Jobs since there's no Job determined | 274 // Reset the Request will cancel all the Jobs since there's no Job determined |
| (...skipping 13 matching lines...) Expand all Loading... |
| 288 session_deps_.proxy_service.reset( | 288 session_deps_.proxy_service.reset( |
| 289 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 289 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 290 base::WrapUnique(proxy_resolver_factory), nullptr)); | 290 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 291 Initialize(false); | 291 Initialize(false); |
| 292 | 292 |
| 293 HttpRequestInfo request_info; | 293 HttpRequestInfo request_info; |
| 294 request_info.method = "GET"; | 294 request_info.method = "GET"; |
| 295 request_info.url = GURL("https://www.google.com"); | 295 request_info.url = GURL("https://www.google.com"); |
| 296 | 296 |
| 297 url::SchemeHostPort server(request_info.url); | 297 url::SchemeHostPort server(request_info.url); |
| 298 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 298 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 299 SetAlternativeService(request_info, alternative_service); | 299 SetAlternativeService(request_info, alternative_service); |
| 300 | 300 |
| 301 request_.reset( | 301 request_.reset( |
| 302 job_controller_->Start(request_info, &request_delegate_, nullptr, | 302 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 303 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 303 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 304 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 304 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 305 EXPECT_TRUE(job_controller_->main_job()); | 305 EXPECT_TRUE(job_controller_->main_job()); |
| 306 EXPECT_TRUE(job_controller_->alternative_job()); | 306 EXPECT_TRUE(job_controller_->alternative_job()); |
| 307 | 307 |
| 308 // We have the main job with unknown status when the alternative job is failed | 308 // We have the main job with unknown status when the alternative job is failed |
| (...skipping 23 matching lines...) Expand all Loading... |
| 332 session_deps_.proxy_service.reset( | 332 session_deps_.proxy_service.reset( |
| 333 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 333 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 334 base::WrapUnique(proxy_resolver_factory), nullptr)); | 334 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 335 Initialize(false); | 335 Initialize(false); |
| 336 | 336 |
| 337 HttpRequestInfo request_info; | 337 HttpRequestInfo request_info; |
| 338 request_info.method = "GET"; | 338 request_info.method = "GET"; |
| 339 request_info.url = GURL("https://www.google.com"); | 339 request_info.url = GURL("https://www.google.com"); |
| 340 | 340 |
| 341 url::SchemeHostPort server(request_info.url); | 341 url::SchemeHostPort server(request_info.url); |
| 342 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 342 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 343 SetAlternativeService(request_info, alternative_service); | 343 SetAlternativeService(request_info, alternative_service); |
| 344 | 344 |
| 345 request_.reset( | 345 request_.reset( |
| 346 job_controller_->Start(request_info, &request_delegate_, nullptr, | 346 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 347 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 347 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 348 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 348 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 349 EXPECT_TRUE(job_controller_->main_job()); | 349 EXPECT_TRUE(job_controller_->main_job()); |
| 350 EXPECT_TRUE(job_controller_->alternative_job()); | 350 EXPECT_TRUE(job_controller_->alternative_job()); |
| 351 | 351 |
| 352 // Main job succeeds, starts serving Request and it should report status | 352 // Main job succeeds, starts serving Request and it should report status |
| (...skipping 30 matching lines...) Expand all Loading... |
| 383 session_deps_.proxy_service.reset( | 383 session_deps_.proxy_service.reset( |
| 384 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 384 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 385 base::WrapUnique(proxy_resolver_factory), nullptr)); | 385 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 386 Initialize(false); | 386 Initialize(false); |
| 387 | 387 |
| 388 HttpRequestInfo request_info; | 388 HttpRequestInfo request_info; |
| 389 request_info.method = "GET"; | 389 request_info.method = "GET"; |
| 390 request_info.url = GURL("https://www.google.com"); | 390 request_info.url = GURL("https://www.google.com"); |
| 391 | 391 |
| 392 url::SchemeHostPort server(request_info.url); | 392 url::SchemeHostPort server(request_info.url); |
| 393 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 393 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 394 SetAlternativeService(request_info, alternative_service); | 394 SetAlternativeService(request_info, alternative_service); |
| 395 | 395 |
| 396 request_.reset( | 396 request_.reset( |
| 397 job_controller_->Start(request_info, &request_delegate_, nullptr, | 397 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 398 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 398 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 399 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 399 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 400 EXPECT_TRUE(job_controller_->main_job()); | 400 EXPECT_TRUE(job_controller_->main_job()); |
| 401 EXPECT_TRUE(job_controller_->alternative_job()); | 401 EXPECT_TRUE(job_controller_->alternative_job()); |
| 402 | 402 |
| 403 // |main_job| fails but should not report status to Request. | 403 // |main_job| fails but should not report status to Request. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 428 session_deps_.proxy_service.reset( | 428 session_deps_.proxy_service.reset( |
| 429 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 429 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 430 base::WrapUnique(proxy_resolver_factory), nullptr)); | 430 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 431 Initialize(false); | 431 Initialize(false); |
| 432 | 432 |
| 433 HttpRequestInfo request_info; | 433 HttpRequestInfo request_info; |
| 434 request_info.method = "GET"; | 434 request_info.method = "GET"; |
| 435 request_info.url = GURL("https://www.google.com"); | 435 request_info.url = GURL("https://www.google.com"); |
| 436 | 436 |
| 437 url::SchemeHostPort server(request_info.url); | 437 url::SchemeHostPort server(request_info.url); |
| 438 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 438 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 439 SetAlternativeService(request_info, alternative_service); | 439 SetAlternativeService(request_info, alternative_service); |
| 440 | 440 |
| 441 request_.reset( | 441 request_.reset( |
| 442 job_controller_->Start(request_info, &request_delegate_, nullptr, | 442 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 443 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 443 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 444 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 444 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 445 EXPECT_TRUE(job_controller_->main_job()); | 445 EXPECT_TRUE(job_controller_->main_job()); |
| 446 EXPECT_TRUE(job_controller_->alternative_job()); | 446 EXPECT_TRUE(job_controller_->alternative_job()); |
| 447 | 447 |
| 448 // |alternative_job| fails but should not report status to Request. | 448 // |alternative_job| fails but should not report status to Request. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 475 session_deps_.proxy_service.reset(new ProxyService( | 475 session_deps_.proxy_service.reset(new ProxyService( |
| 476 base::WrapUnique(new ProxyConfigServiceFixed(proxy_config)), | 476 base::WrapUnique(new ProxyConfigServiceFixed(proxy_config)), |
| 477 base::WrapUnique(proxy_resolver_factory), nullptr)); | 477 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 478 Initialize(false); | 478 Initialize(false); |
| 479 | 479 |
| 480 HttpRequestInfo request_info; | 480 HttpRequestInfo request_info; |
| 481 request_info.method = "GET"; | 481 request_info.method = "GET"; |
| 482 request_info.url = GURL("https://www.google.com"); | 482 request_info.url = GURL("https://www.google.com"); |
| 483 | 483 |
| 484 url::SchemeHostPort server(request_info.url); | 484 url::SchemeHostPort server(request_info.url); |
| 485 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 485 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 486 SetAlternativeService(request_info, alternative_service); | 486 SetAlternativeService(request_info, alternative_service); |
| 487 | 487 |
| 488 request_.reset( | 488 request_.reset( |
| 489 job_controller_->Start(request_info, &request_delegate_, nullptr, | 489 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 490 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 490 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 491 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 491 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 492 EXPECT_TRUE(job_controller_->main_job()); | 492 EXPECT_TRUE(job_controller_->main_job()); |
| 493 EXPECT_TRUE(job_controller_->alternative_job()); | 493 EXPECT_TRUE(job_controller_->alternative_job()); |
| 494 | 494 |
| 495 // |main_job| fails but should not report status to Request. | 495 // |main_job| fails but should not report status to Request. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 524 base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 524 base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 525 base::WrapUnique(new FailingProxyResolverFactory), nullptr)); | 525 base::WrapUnique(new FailingProxyResolverFactory), nullptr)); |
| 526 | 526 |
| 527 Initialize(false); | 527 Initialize(false); |
| 528 | 528 |
| 529 HttpRequestInfo request_info; | 529 HttpRequestInfo request_info; |
| 530 request_info.method = "GET"; | 530 request_info.method = "GET"; |
| 531 request_info.url = GURL("https://www.google.com"); | 531 request_info.url = GURL("https://www.google.com"); |
| 532 | 532 |
| 533 url::SchemeHostPort server(request_info.url); | 533 url::SchemeHostPort server(request_info.url); |
| 534 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 534 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 535 SetAlternativeService(request_info, alternative_service); | 535 SetAlternativeService(request_info, alternative_service); |
| 536 | 536 |
| 537 request_.reset( | 537 request_.reset( |
| 538 job_controller_->Start(request_info, &request_delegate_, nullptr, | 538 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 539 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 539 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 540 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 540 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 541 EXPECT_TRUE(job_controller_->main_job()); | 541 EXPECT_TRUE(job_controller_->main_job()); |
| 542 EXPECT_TRUE(job_controller_->alternative_job()); | 542 EXPECT_TRUE(job_controller_->alternative_job()); |
| 543 | 543 |
| 544 // Wait until OnStreamFailedCallback is executed on the alternative job. | 544 // Wait until OnStreamFailedCallback is executed on the alternative job. |
| 545 EXPECT_CALL(request_delegate_, OnStreamFailed(_, _)).Times(1); | 545 EXPECT_CALL(request_delegate_, OnStreamFailed(_, _)).Times(1); |
| 546 base::RunLoop().RunUntilIdle(); | 546 base::RunLoop().RunUntilIdle(); |
| 547 } | 547 } |
| 548 | 548 |
| 549 TEST_F(HttpStreamFactoryImplJobControllerTest, InvalidPortForQuic) { | 549 TEST_F(HttpStreamFactoryImplJobControllerTest, InvalidPortForQuic) { |
| 550 // Using a restricted port 101 for QUIC should fail and the alternative job | 550 // Using a restricted port 101 for QUIC should fail and the alternative job |
| 551 // should post OnStreamFailedCall on the controller to resume the main job. | 551 // should post OnStreamFailedCall on the controller to resume the main job. |
| 552 Initialize(false); | 552 Initialize(false); |
| 553 | 553 |
| 554 HttpRequestInfo request_info; | 554 HttpRequestInfo request_info; |
| 555 request_info.method = "GET"; | 555 request_info.method = "GET"; |
| 556 request_info.url = GURL("https://www.google.com"); | 556 request_info.url = GURL("https://www.google.com"); |
| 557 | 557 |
| 558 url::SchemeHostPort server(request_info.url); | 558 url::SchemeHostPort server(request_info.url); |
| 559 AlternativeService alternative_service(kProtoQUIC, server.host(), 101); | 559 AlternativeService alternative_service(QUIC, server.host(), 101); |
| 560 SetAlternativeService(request_info, alternative_service); | 560 SetAlternativeService(request_info, alternative_service); |
| 561 | 561 |
| 562 request_.reset( | 562 request_.reset( |
| 563 job_controller_->Start(request_info, &request_delegate_, nullptr, | 563 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 564 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 564 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 565 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 565 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 566 | 566 |
| 567 EXPECT_TRUE(job_factory_.main_job()->is_waiting()); | 567 EXPECT_TRUE(job_factory_.main_job()->is_waiting()); |
| 568 | 568 |
| 569 // Wait until OnStreamFailedCallback is executed on the alternative job. | 569 // Wait until OnStreamFailedCallback is executed on the alternative job. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 591 session_deps_.host_resolver->set_synchronous_mode(false); | 591 session_deps_.host_resolver->set_synchronous_mode(false); |
| 592 | 592 |
| 593 Initialize(false); | 593 Initialize(false); |
| 594 | 594 |
| 595 HttpRequestInfo request_info; | 595 HttpRequestInfo request_info; |
| 596 request_info.method = "GET"; | 596 request_info.method = "GET"; |
| 597 request_info.url = GURL("https://www.google.com"); | 597 request_info.url = GURL("https://www.google.com"); |
| 598 | 598 |
| 599 // Set a SPDY alternative service for the server. | 599 // Set a SPDY alternative service for the server. |
| 600 url::SchemeHostPort server(request_info.url); | 600 url::SchemeHostPort server(request_info.url); |
| 601 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 601 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 602 SetAlternativeService(request_info, alternative_service); | 602 SetAlternativeService(request_info, alternative_service); |
| 603 // Hack to use different URL for the main job to help differentiate the proxy | 603 // Hack to use different URL for the main job to help differentiate the proxy |
| 604 // requests. | 604 // requests. |
| 605 job_factory_.UseDifferentURLForMainJob(GURL("http://www.google.com")); | 605 job_factory_.UseDifferentURLForMainJob(GURL("http://www.google.com")); |
| 606 | 606 |
| 607 request_.reset( | 607 request_.reset( |
| 608 job_controller_->Start(request_info, &request_delegate_, nullptr, | 608 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 609 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 609 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 610 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 610 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 611 // Both jobs should be created but stalled as proxy resolution not completed. | 611 // Both jobs should be created but stalled as proxy resolution not completed. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), | 653 new ProxyService(base::MakeUnique<ProxyConfigServiceFixed>(proxy_config), |
| 654 base::WrapUnique(proxy_resolver_factory), nullptr)); | 654 base::WrapUnique(proxy_resolver_factory), nullptr)); |
| 655 | 655 |
| 656 Initialize(false); | 656 Initialize(false); |
| 657 | 657 |
| 658 HttpRequestInfo request_info; | 658 HttpRequestInfo request_info; |
| 659 request_info.method = "GET"; | 659 request_info.method = "GET"; |
| 660 request_info.url = GURL("https://www.google.com"); | 660 request_info.url = GURL("https://www.google.com"); |
| 661 | 661 |
| 662 url::SchemeHostPort server(request_info.url); | 662 url::SchemeHostPort server(request_info.url); |
| 663 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 663 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 664 SetAlternativeService(request_info, alternative_service); | 664 SetAlternativeService(request_info, alternative_service); |
| 665 // Hack to use different URL for the main job to help differentiate the proxy | 665 // Hack to use different URL for the main job to help differentiate the proxy |
| 666 // requests. | 666 // requests. |
| 667 job_factory_.UseDifferentURLForMainJob(GURL("http://www.google.com")); | 667 job_factory_.UseDifferentURLForMainJob(GURL("http://www.google.com")); |
| 668 | 668 |
| 669 request_.reset( | 669 request_.reset( |
| 670 job_controller_->Start(request_info, &request_delegate_, nullptr, | 670 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 671 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 671 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 672 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 672 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 673 EXPECT_TRUE(job_controller_->main_job()); | 673 EXPECT_TRUE(job_controller_->main_job()); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 stats1.srtt = base::TimeDelta::FromMicroseconds(10); | 715 stats1.srtt = base::TimeDelta::FromMicroseconds(10); |
| 716 session_->http_server_properties()->SetServerNetworkStats( | 716 session_->http_server_properties()->SetServerNetworkStats( |
| 717 url::SchemeHostPort(GURL("https://www.google.com")), stats1); | 717 url::SchemeHostPort(GURL("https://www.google.com")), stats1); |
| 718 | 718 |
| 719 HttpRequestInfo request_info; | 719 HttpRequestInfo request_info; |
| 720 request_info.method = "GET"; | 720 request_info.method = "GET"; |
| 721 request_info.url = GURL("https://www.google.com"); | 721 request_info.url = GURL("https://www.google.com"); |
| 722 | 722 |
| 723 // Set a SPDY alternative service for the server. | 723 // Set a SPDY alternative service for the server. |
| 724 url::SchemeHostPort server(request_info.url); | 724 url::SchemeHostPort server(request_info.url); |
| 725 AlternativeService alternative_service(kProtoQUIC, server.host(), 443); | 725 AlternativeService alternative_service(QUIC, server.host(), 443); |
| 726 SetAlternativeService(request_info, alternative_service); | 726 SetAlternativeService(request_info, alternative_service); |
| 727 | 727 |
| 728 request_.reset( | 728 request_.reset( |
| 729 job_controller_->Start(request_info, &request_delegate_, nullptr, | 729 job_controller_->Start(request_info, &request_delegate_, nullptr, |
| 730 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, | 730 NetLogWithSource(), HttpStreamRequest::HTTP_STREAM, |
| 731 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); | 731 DEFAULT_PRIORITY, SSLConfig(), SSLConfig())); |
| 732 EXPECT_TRUE(job_controller_->main_job()); | 732 EXPECT_TRUE(job_controller_->main_job()); |
| 733 EXPECT_TRUE(job_controller_->alternative_job()); | 733 EXPECT_TRUE(job_controller_->alternative_job()); |
| 734 | 734 |
| 735 // The alternative job stalls as host resolution hangs when creating the QUIC | 735 // The alternative job stalls as host resolution hangs when creating the QUIC |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 // Reset the request as it's been successfully served. | 947 // Reset the request as it's been successfully served. |
| 948 request_.reset(); | 948 request_.reset(); |
| 949 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); | 949 EXPECT_TRUE(HttpStreamFactoryImplPeer::IsJobControllerDeleted(factory_)); |
| 950 | 950 |
| 951 histogram_tester.ExpectUniqueSample("Net.QuicAlternativeProxy.Usage", | 951 histogram_tester.ExpectUniqueSample("Net.QuicAlternativeProxy.Usage", |
| 952 2 /* ALTERNATIVE_PROXY_USAGE_LOST_RACE */, | 952 2 /* ALTERNATIVE_PROXY_USAGE_LOST_RACE */, |
| 953 1); | 953 1); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace net | 956 } // namespace net |
| OLD | NEW |