| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 FrameFetchContext* childFetchContext = createChildFrame(); | 426 FrameFetchContext* childFetchContext = createChildFrame(); |
| 427 | 427 |
| 428 // Child frame as part of back/forward | 428 // Child frame as part of back/forward |
| 429 document->frame()->loader().setLoadType(FrameLoadTypeBackForward); | 429 document->frame()->loader().setLoadType(FrameLoadTypeBackForward); |
| 430 EXPECT_EQ(ReturnCacheDataElseLoad, childFetchContext->resourceRequestCachePo
licy(request, Resource::MainResource)); | 430 EXPECT_EQ(ReturnCacheDataElseLoad, childFetchContext->resourceRequestCachePo
licy(request, Resource::MainResource)); |
| 431 | 431 |
| 432 // Child frame as part of reload | 432 // Child frame as part of reload |
| 433 document->frame()->loader().setLoadType(FrameLoadTypeReload); | 433 document->frame()->loader().setLoadType(FrameLoadTypeReload); |
| 434 EXPECT_EQ(ValidatingCacheData, childFetchContext->resourceRequestCachePolicy
(request, Resource::MainResource)); | 434 EXPECT_EQ(ValidatingCacheData, childFetchContext->resourceRequestCachePolicy
(request, Resource::MainResource)); |
| 435 | 435 |
| 436 // Child frame as part of end to end reload | 436 // Child frame as part of reload bypassing cache |
| 437 document->frame()->loader().setLoadType(FrameLoadTypeReloadFromOrigin); | 437 document->frame()->loader().setLoadType(FrameLoadTypeReloadBypassingCache); |
| 438 EXPECT_EQ(BypassingCache, childFetchContext->resourceRequestCachePolicy(requ
est, Resource::MainResource)); | 438 EXPECT_EQ(BypassingCache, childFetchContext->resourceRequestCachePolicy(requ
est, Resource::MainResource)); |
| 439 } | 439 } |
| 440 | 440 |
| 441 TEST_F(FrameFetchContextTest, ModifyPriorityForExperiments) | 441 TEST_F(FrameFetchContextTest, ModifyPriorityForExperiments) |
| 442 { | 442 { |
| 443 Settings* settings = document->frame()->settings(); | 443 Settings* settings = document->frame()->settings(); |
| 444 FetchRequest request(ResourceRequest("http://www.example.com"), FetchInitiat
orInfo()); | 444 FetchRequest request(ResourceRequest("http://www.example.com"), FetchInitiat
orInfo()); |
| 445 | 445 |
| 446 FetchRequest preloadRequest(ResourceRequest("http://www.example.com"), Fetch
InitiatorInfo()); | 446 FetchRequest preloadRequest(ResourceRequest("http://www.example.com"), Fetch
InitiatorInfo()); |
| 447 preloadRequest.setForPreload(true); | 447 preloadRequest.setForPreload(true); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource
); | 709 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource
); |
| 710 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation); | 710 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation); |
| 711 | 711 |
| 712 ResourceRequest subRequest(test.url); | 712 ResourceRequest subRequest(test.url); |
| 713 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); | 713 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); |
| 714 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation); | 714 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation); |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace blink | 718 } // namespace blink |
| OLD | NEW |