| OLD | NEW |
| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 document->loader()->setLoadType(FrameLoadTypeReload); | 595 document->loader()->setLoadType(FrameLoadTypeReload); |
| 596 EXPECT_EQ(WebCachePolicy::UseProtocolCachePolicy, | 596 EXPECT_EQ(WebCachePolicy::UseProtocolCachePolicy, |
| 597 childFetchContext->resourceRequestCachePolicy( | 597 childFetchContext->resourceRequestCachePolicy( |
| 598 request, Resource::MainResource, FetchRequest::NoDefer)); | 598 request, Resource::MainResource, FetchRequest::NoDefer)); |
| 599 | 599 |
| 600 // Child frame as part of reload bypassing cache | 600 // Child frame as part of reload bypassing cache |
| 601 document->loader()->setLoadType(FrameLoadTypeReloadBypassingCache); | 601 document->loader()->setLoadType(FrameLoadTypeReloadBypassingCache); |
| 602 EXPECT_EQ(WebCachePolicy::BypassingCache, | 602 EXPECT_EQ(WebCachePolicy::BypassingCache, |
| 603 childFetchContext->resourceRequestCachePolicy( | 603 childFetchContext->resourceRequestCachePolicy( |
| 604 request, Resource::MainResource, FetchRequest::NoDefer)); | 604 request, Resource::MainResource, FetchRequest::NoDefer)); |
| 605 |
| 606 // Per-frame bypassing reload, but parent load type is different. |
| 607 // This is not the case users can trigger through user interfaces, but for |
| 608 // checking code correctness and consistency. |
| 609 document->loader()->setLoadType(FrameLoadTypeReload); |
| 610 childFrame->loader().documentLoader()->setLoadType( |
| 611 FrameLoadTypeReloadBypassingCache); |
| 612 EXPECT_EQ(WebCachePolicy::BypassingCache, |
| 613 childFetchContext->resourceRequestCachePolicy( |
| 614 request, Resource::MainResource, FetchRequest::NoDefer)); |
| 605 } | 615 } |
| 606 | 616 |
| 607 TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) { | 617 TEST_F(FrameFetchContextTest, SetFirstPartyCookieAndRequestorOrigin) { |
| 608 struct TestCase { | 618 struct TestCase { |
| 609 const char* documentURL; | 619 const char* documentURL; |
| 610 bool documentSandboxed; | 620 bool documentSandboxed; |
| 611 const char* requestorOrigin; // "" => unique origin | 621 const char* requestorOrigin; // "" => unique origin |
| 612 WebURLRequest::FrameType frameType; | 622 WebURLRequest::FrameType frameType; |
| 613 const char* serializedOrigin; // "" => unique origin | 623 const char* serializedOrigin; // "" => unique origin |
| 614 } cases[] = { | 624 } cases[] = { |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 setFilterPolicy(WebDocumentSubresourceFilter::WouldDisallow); | 941 setFilterPolicy(WebDocumentSubresourceFilter::WouldDisallow); |
| 932 | 942 |
| 933 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequest()); | 943 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequest()); |
| 934 EXPECT_EQ(0, getFilteredLoadCallCount()); | 944 EXPECT_EQ(0, getFilteredLoadCallCount()); |
| 935 | 945 |
| 936 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequestPreload()); | 946 EXPECT_EQ(ResourceRequestBlockedReason::None, canRequestPreload()); |
| 937 EXPECT_EQ(0, getFilteredLoadCallCount()); | 947 EXPECT_EQ(0, getFilteredLoadCallCount()); |
| 938 } | 948 } |
| 939 | 949 |
| 940 } // namespace blink | 950 } // namespace blink |
| OLD | NEW |