Changeset 181728 in webkit
- Timestamp:
- Mar 18, 2015 10:21:40 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181724 r181728 1 2015-03-18 Antti Koivisto <antti@apple.com> 2 3 Test disk cache behavior when using back navigation cache policy 4 https://bugs.webkit.org/show_bug.cgi?id=142848 5 6 Reviewed by Chris Dumez. 7 8 * http/tests/cache/disk-cache-validation-back-navigation-policy-expected.txt: Added. 9 * http/tests/cache/disk-cache-validation-back-navigation-policy.html: Added. 10 11 Test permutations of cache headers on reload including Cache-control: must-revalidate. 12 13 * platform/mac-wk1/TestExpectations: 14 * platform/win/TestExpectations: 15 1 16 2015-03-18 Joseph Pecoraro <pecoraro@apple.com> 2 17 -
trunk/LayoutTests/http/tests/cache/disk-cache-validation.html
r177294 r181728 40 40 debug(""); 41 41 42 runTests( generateTests(testMatrix));42 runTests(tests); 43 43 44 44 </script> -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r181651 r181728 94 94 # Disk cache is WK2 only 95 95 http/tests/cache/disk-cache-validation.html 96 http/tests/cache/disk-cache-validation-back-navigation-policy.html 96 97 http/tests/cache/disk-cache-disable.html 97 98 http/tests/cache/disk-cache-vary-cookie.html -
trunk/LayoutTests/platform/win/TestExpectations
r181680 r181728 2231 2231 # Disk cache is WK2 only 2232 2232 http/tests/cache/disk-cache-validation.html 2233 http/tests/cache/disk-cache-validation-back-navigation-policy.html 2233 2234 http/tests/cache/disk-cache-disable.html 2234 2235 http/tests/cache/disk-cache-vary-cookie.html -
trunk/Source/WebCore/ChangeLog
r181727 r181728 1 2015-03-18 Antti Koivisto <antti@apple.com> 2 3 Test disk cache behavior when using back navigation cache policy 4 https://bugs.webkit.org/show_bug.cgi?id=142848 5 6 Reviewed by Chris Dumez. 7 8 Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading. 9 10 Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html 11 12 * loader/FrameLoader.cpp: 13 (WebCore::FrameLoader::addExtraFieldsToRequest): 14 * loader/FrameLoader.h: 15 (WebCore::FrameLoader::setOverrideCachePolicyForTesting): 16 * testing/Internals.cpp: 17 (WebCore::Internals::setOverrideCachePolicy): 18 * testing/Internals.h: 19 * testing/Internals.idl: 20 1 21 2015-03-18 Yusuke Suzuki <utatane.tea@gmail.com> 2 22 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r181649 r181728 2559 2559 request.setCachePolicy(ReloadIgnoringCacheData); 2560 2560 2561 if (m_overrideCachePolicyForTesting) 2562 request.setCachePolicy(m_overrideCachePolicyForTesting.value()); 2563 2561 2564 if (request.cachePolicy() == ReloadIgnoringCacheData) { 2562 2565 if (loadType == FrameLoadType::Reload) -
trunk/Source/WebCore/loader/FrameLoader.h
r180301 r181728 42 42 #include "ResourceHandleTypes.h" 43 43 #include "ResourceLoadNotifier.h" 44 #include "ResourceRequestBase.h" 44 45 #include "SecurityContext.h" 45 46 #include "Timer.h" 46 47 #include <wtf/Forward.h> 47 48 #include <wtf/HashSet.h> 49 #include <wtf/Optional.h> 48 50 49 51 namespace WebCore { … … 288 290 void forcePageTransitionIfNeeded(); 289 291 292 void setOverrideCachePolicyForTesting(ResourceRequestCachePolicy policy) { m_overrideCachePolicyForTesting = policy; } 293 void clearOverrideCachePolicyForTesting() { m_overrideCachePolicyForTesting = Nullopt; } 294 290 295 private: 291 296 enum FormSubmissionCacheLoadPolicy { … … 436 441 437 442 RefPtr<FrameNetworkingContext> m_networkingContext; 443 444 Optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting; 438 445 439 446 URL m_previousURL; -
trunk/Source/WebCore/testing/Internals.cpp
r181615 r181728 309 309 if (page->mainFrame().editor().isOverwriteModeEnabled()) 310 310 page->mainFrame().editor().toggleOverwriteModeEnabled(); 311 page->mainFrame().loader().clearOverrideCachePolicyForTesting(); 311 312 ApplicationCacheStorage::singleton().setDefaultOriginQuota(ApplicationCacheStorage::noQuota()); 312 313 #if ENABLE(VIDEO) … … 424 425 ASSERT_NOT_REACHED(); 425 426 return "Error"; 427 } 428 429 static ResourceRequestCachePolicy stringToResourceRequestCachePolicy(const String& policy) 430 { 431 if (policy == "UseProtocolCachePolicy") 432 return UseProtocolCachePolicy; 433 if (policy == "ReloadIgnoringCacheData") 434 return ReloadIgnoringCacheData; 435 if (policy == "ReturnCacheDataElseLoad") 436 return ReturnCacheDataElseLoad; 437 if (policy == "ReturnCacheDataDontLoad") 438 return ReturnCacheDataDontLoad; 439 ASSERT_NOT_REACHED(); 440 return UseProtocolCachePolicy; 441 } 442 443 void Internals::setOverrideCachePolicy(const String& policy) 444 { 445 frame()->loader().setOverrideCachePolicyForTesting(stringToResourceRequestCachePolicy(policy)); 426 446 } 427 447 -
trunk/Source/WebCore/testing/Internals.h
r181408 r181728 90 90 bool isLoadingFromMemoryCache(const String& url); 91 91 String xhrResponseSource(XMLHttpRequest*); 92 void setOverrideCachePolicy(const String&); 92 93 93 94 void clearMemoryCache(); -
trunk/Source/WebCore/testing/Internals.idl
r181408 r181728 30 30 }; 31 31 32 // These map to ResourceRequestCachePolicy. 33 enum CachePolicy { 34 "UseProtocolCachePolicy", 35 "ReloadIgnoringCacheData", 36 "ReturnCacheDataElseLoad", 37 "ReturnCacheDataDontLoad" 38 }; 39 40 32 41 [ 33 42 NoInterfaceObject, … … 47 56 void pruneMemoryCacheToSize(long size); 48 57 long memoryCacheSize(); 58 void setOverrideCachePolicy(CachePolicy policy); 49 59 50 60 void clearPageCache();
Note: See TracChangeset
for help on using the changeset viewer.