Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: content/browser/loader/resource_loader_unittest.cc

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // frame. 440 // frame.
441 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) || 441 ASSERT_TRUE((resource_type != RESOURCE_TYPE_MAIN_FRAME) ||
442 belongs_to_main_frame); 442 belongs_to_main_frame);
443 443
444 RenderFrameHost* rfh = web_contents_->GetMainFrame(); 444 RenderFrameHost* rfh = web_contents_->GetMainFrame();
445 ResourceRequestInfo::AllocateForTesting( 445 ResourceRequestInfo::AllocateForTesting(
446 request.get(), resource_type, &resource_context_, 446 request.get(), resource_type, &resource_context_,
447 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(), 447 rfh->GetProcess()->GetID(), rfh->GetRenderViewHost()->GetRoutingID(),
448 rfh->GetRoutingID(), belongs_to_main_frame, 448 rfh->GetRoutingID(), belongs_to_main_frame,
449 false /* parent_is_main_frame */, true /* allow_download */, 449 false /* parent_is_main_frame */, true /* allow_download */,
450 false /* is_async */, false /* is_using_lofi_ */); 450 false /* is_async */, PREVIEWS_OFF /* previews_state */);
451 std::unique_ptr<TestResourceHandler> resource_handler( 451 std::unique_ptr<TestResourceHandler> resource_handler(
452 new TestResourceHandler(nullptr, nullptr)); 452 new TestResourceHandler(nullptr, nullptr));
453 raw_ptr_resource_handler_ = resource_handler.get(); 453 raw_ptr_resource_handler_ = resource_handler.get();
454 loader_.reset(new ResourceLoader( 454 loader_.reset(new ResourceLoader(
455 std::move(request), 455 std::move(request),
456 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_), 456 WrapResourceHandler(std::move(resource_handler), raw_ptr_to_request_),
457 this)); 457 this));
458 } 458 }
459 459
460 void SetUpResourceLoaderForUrl(const GURL& test_url) { 460 void SetUpResourceLoaderForUrl(const GURL& test_url) {
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 1602
1603 // Tests that the effective connection type is not set on non-main frame 1603 // Tests that the effective connection type is not set on non-main frame
1604 // requests. 1604 // requests.
1605 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) { 1605 TEST_F(EffectiveConnectionTypeResourceLoaderTest, DoesNotBelongToMainFrame) {
1606 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false, 1606 VerifyEffectiveConnectionType(RESOURCE_TYPE_OBJECT, false,
1607 net::EFFECTIVE_CONNECTION_TYPE_3G, 1607 net::EFFECTIVE_CONNECTION_TYPE_3G,
1608 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN); 1608 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN);
1609 } 1609 }
1610 1610
1611 } // namespace content 1611 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698