From c8c2d1901aec01e934adf561a9fdf0cc776cdef8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 29 Jan 2018 16:35:13 +0100 Subject: BASELINE: Update Chromium to 64.0.3282.139 Change-Id: I1cae68fe9c94ff7608b26b8382fc19862cdb293a Reviewed-by: Alexandru Croitor --- .../browser/loader/resource_loader_unittest.cc | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'chromium/content/browser/loader/resource_loader_unittest.cc') diff --git a/chromium/content/browser/loader/resource_loader_unittest.cc b/chromium/content/browser/loader/resource_loader_unittest.cc index 99e5fd051bd..f8f3b770326 100644 --- a/chromium/content/browser/loader/resource_loader_unittest.cc +++ b/chromium/content/browser/loader/resource_loader_unittest.cc @@ -352,8 +352,8 @@ class ResourceLoaderTest : public testing::Test, : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), test_url_request_context_(true), resource_context_(&test_url_request_context_), - raw_ptr_resource_handler_(NULL), - raw_ptr_to_request_(NULL) { + raw_ptr_resource_handler_(nullptr), + raw_ptr_to_request_(nullptr) { test_url_request_context_.set_job_factory(&job_factory_); test_url_request_context_.set_network_quality_estimator( &network_quality_estimator_); @@ -410,7 +410,8 @@ class ResourceLoaderTest : public testing::Test, request.get(), resource_type, &resource_context_, rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), rfh->GetRoutingID(), belongs_to_main_frame, true /* allow_download */, - false /* is_async */, PREVIEWS_OFF /* previews_state */); + false /* is_async */, PREVIEWS_OFF /* previews_state */, + nullptr /* navigation_ui_data */); std::unique_ptr resource_handler( new TestResourceHandler(nullptr, nullptr)); raw_ptr_resource_handler_ = resource_handler.get(); @@ -460,7 +461,7 @@ class ResourceLoaderTest : public testing::Test, ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) override { - return NULL; + return nullptr; } bool HandleExternalProtocol(ResourceLoader* loader, const GURL& url) override { @@ -595,6 +596,15 @@ class HTTPSSecurityInfoResourceLoaderTest : public ResourceLoaderTest { const GURL test_https_redirect_url_; }; +TEST_F(HTTPSSecurityInfoResourceLoaderTest, CertStatusOnResponse) { + SetUpResourceLoaderForUrl(test_https_url()); + loader_->StartRequest(); + raw_ptr_resource_handler_->WaitUntilResponseComplete(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(kTestCertError, + raw_ptr_resource_handler_->resource_response()->head.cert_status); +} + // Tests that client certificates are requested with ClientCertStore lookup. TEST_F(ClientCertResourceLoaderTest, WithStoreLookup) { // Set up the test client cert store. @@ -727,6 +737,19 @@ TEST_F(ClientCertResourceLoaderTest, StoreAsyncCancel) { base::RunLoop().RunUntilIdle(); } +// Tests that a RESOURCE_TYPE_PREFETCH request sets the LOAD_PREFETCH flag. +TEST_F(ResourceLoaderTest, PrefetchFlag) { + std::unique_ptr request( + resource_context_.GetRequestContext()->CreateRequest( + test_async_url(), net::DEFAULT_PRIORITY, nullptr /* delegate */, + TRAFFIC_ANNOTATION_FOR_TESTS)); + SetUpResourceLoader(std::move(request), RESOURCE_TYPE_PREFETCH, true); + + loader_->StartRequest(); + raw_ptr_resource_handler_->WaitUntilResponseComplete(); + EXPECT_EQ(test_data(), raw_ptr_resource_handler_->body()); +} + // Test the case the ResourceHandler defers nothing. TEST_F(ResourceLoaderTest, SyncResourceHandler) { loader_->StartRequest(); -- cgit v1.2.1