OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // frame. | 434 // frame. |
435 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) || | 435 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) || |
436 belongs_to_main_frame); | 436 belongs_to_main_frame); |
437 | 437 |
438 RenderFrameHost* rfh = web_contents_->GetMainFrame(); | 438 RenderFrameHost* rfh = web_contents_->GetMainFrame(); |
439 ResourceRequestInfo::AllocateForTesting( | 439 ResourceRequestInfo::AllocateForTesting( |
440 request.get(), resource_type, &resource_context_, | 440 request.get(), resource_type, &resource_context_, |
441 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), | 441 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), |
442 rfh->GetRoutingID(), belongs_to_main_frame, | 442 rfh->GetRoutingID(), belongs_to_main_frame, |
443 false /* parent_is_main_frame */, true /* allow_download */, | 443 false /* parent_is_main_frame */, true /* allow_download */, |
444 false /* is_async */, false /* is_using_lofi_ */); | 444 false /* is_async */, PREVIEWS_OFF /* previews_state */); |
445 std::unique_ptr<TestResourceHandler> resource_handler( | 445 std::unique_ptr<TestResourceHandler> resource_handler( |
446 new TestResourceHandler(nullptr, nullptr)); | 446 new TestResourceHandler(nullptr, nullptr)); |
447 raw_ptr_resource_handler_ = resource_handler.get(); | 447 raw_ptr_resource_handler_ = resource_handler.get(); |
448 loader_.reset(new ResourceLoader( | 448 loader_.reset(new ResourceLoader( |
449 std::move(request), | 449 std::move(request), |
450 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_), | 450 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_), |
451 this)); | 451 this)); |
452 } | 452 } |
453 | 453 |
454 void SetUpResourceLoaderForUrl(const GURL& test_url) { | 454 void SetUpResourceLoaderForUrl(const GURL& test_url) { |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 | 1426 |
1427 // Tests that the effective connection type is not set on non-main frame | 1427 // Tests that the effective connection type is not set on non-main frame |
1428 // requests. | 1428 // requests. |
1429 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) { | 1429 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) { |
1430 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false, | 1430 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false, |
1431 net::EFFECTIVE_CONNECTION_TYPE_3G, | 1431 net::EFFECTIVE_CONNECTION_TYPE_3G, |
1432 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); | 1432 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); |
1433 } | 1433 } |
1434 | 1434 |
1435 } // namespace content | 1435 } // namespace content |
OLD | NEW |