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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 2809733003: Move most of FrameLoader::CheckCompleted() to Document (Closed)
Patch Set: Fix failing android test Created 3 years, 8 months 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 /* 1 /*
2 * Copyright (c) 2015, Google Inc. All rights reserved. 2 * Copyright (c) 2015, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 // checking code correctness and consistency. 635 // checking code correctness and consistency.
636 document->Loader()->SetLoadType(kFrameLoadTypeReload); 636 document->Loader()->SetLoadType(kFrameLoadTypeReload);
637 child_frame->Loader().GetDocumentLoader()->SetLoadType( 637 child_frame->Loader().GetDocumentLoader()->SetLoadType(
638 kFrameLoadTypeReloadBypassingCache); 638 kFrameLoadTypeReloadBypassingCache);
639 EXPECT_EQ(WebCachePolicy::kBypassingCache, 639 EXPECT_EQ(WebCachePolicy::kBypassingCache,
640 child_fetch_context->ResourceRequestCachePolicy( 640 child_fetch_context->ResourceRequestCachePolicy(
641 request, Resource::kMainResource, FetchParameters::kNoDefer)); 641 request, Resource::kMainResource, FetchParameters::kNoDefer));
642 } 642 }
643 643
644 TEST_F(FrameFetchContextTest, SubResourceCachePolicy) { 644 TEST_F(FrameFetchContextTest, SubResourceCachePolicy) {
645 // Reset load event state: if the load event is finished, we ignore the
646 // DocumentLoader load type.
647 document->open();
648 ASSERT_FALSE(document->LoadEventFinished());
649
645 // Default case 650 // Default case
646 ResourceRequest request("http://www.example.com/mock"); 651 ResourceRequest request("http://www.example.com/mock");
647 EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy, 652 EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy,
648 fetch_context->ResourceRequestCachePolicy( 653 fetch_context->ResourceRequestCachePolicy(
649 request, Resource::kMock, FetchParameters::kNoDefer)); 654 request, Resource::kMock, FetchParameters::kNoDefer));
650 655
651 // FrameLoadTypeReload should not affect sub-resources 656 // FrameLoadTypeReload should not affect sub-resources
652 document->Loader()->SetLoadType(kFrameLoadTypeReload); 657 document->Loader()->SetLoadType(kFrameLoadTypeReload);
653 EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy, 658 EXPECT_EQ(WebCachePolicy::kUseProtocolCachePolicy,
654 fetch_context->ResourceRequestCachePolicy( 659 fetch_context->ResourceRequestCachePolicy(
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 SetFilterPolicy(WebDocumentSubresourceFilter::kWouldDisallow); 903 SetFilterPolicy(WebDocumentSubresourceFilter::kWouldDisallow);
899 904
900 EXPECT_EQ(ResourceRequestBlockedReason::kNone, CanRequest()); 905 EXPECT_EQ(ResourceRequestBlockedReason::kNone, CanRequest());
901 EXPECT_EQ(0, GetFilteredLoadCallCount()); 906 EXPECT_EQ(0, GetFilteredLoadCallCount());
902 907
903 EXPECT_EQ(ResourceRequestBlockedReason::kNone, CanRequestPreload()); 908 EXPECT_EQ(ResourceRequestBlockedReason::kNone, CanRequestPreload());
904 EXPECT_EQ(0, GetFilteredLoadCallCount()); 909 EXPECT_EQ(0, GetFilteredLoadCallCount());
905 } 910 }
906 911
907 } // namespace blink 912 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698