Title: [188468] trunk
Revision
188468
Author
[email protected]
Date
2015-08-14 07:08:59 -0700 (Fri, 14 Aug 2015)

Log Message

Cover memory cache subresource validation policy with cache tests
https://bugs.webkit.org/show_bug.cgi?id=147830

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Existing tests under http/tests/cache/disk-cache currently cover disk and XHR memory cache validation behaviors.
They can be extended to cover the regular subresource policy too.

Add window.internals API to disable CachedRawResource validation behavior. This makes XHR validate like
other resources and allows existing tests (that use XHR) to cover normal subresource policy .

Test results reveal some bugs. For example subresources in memory cache don't respect Vary header.

It is generally bad that we have a separate XHR-and-main-resource validation policy in memory cache. Network cache
doesn't have one.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearTestingOverrides):
(WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
* loader/FrameLoader.h:
(WebCore::FrameLoader::setOverrideCachePolicyForTesting):
(WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
(WebCore::FrameLoader::setStrictRawResourceValidationPolicyDisabledForTesting):
(WebCore::FrameLoader::isStrictRawResourceValidationPolicyDisabledForTesting):
(WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
(WebCore::CachedResource::loadFinishTime):
(WebCore::CachedResource::canReuse): Deleted.

    Made canReuse non-virtual and removed it from the base. Only CachedRawResource has implementation.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
* testing/Internals.cpp:
(WebCore::Internals::setOverrideResourceLoadPriority):
(WebCore::Internals::setStrictRawResourceValidationPolicyDisabled):
(WebCore::Internals::clearMemoryCache):
* testing/Internals.h:

LayoutTests:

Add another test round using subresource validation policy.

* http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-disable-expected.txt:
* http/tests/cache/disk-cache/disk-cache-media-expected.txt:
* http/tests/cache/disk-cache/disk-cache-range-expected.txt:
* http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt:
* http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt:
* http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt:
* http/tests/cache/disk-cache/resources/cache-test.js:
(loadResourcesWithOptions):
(.):
(runTests):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (188467 => 188468)


--- trunk/LayoutTests/ChangeLog	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/ChangeLog	2015-08-14 14:08:59 UTC (rev 188468)
@@ -1,3 +1,33 @@
+2015-08-13  Antti Koivisto  <[email protected]>
+
+        Cover memory cache subresource validation policy with cache tests
+        https://bugs.webkit.org/show_bug.cgi?id=147830
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add another test round using subresource validation policy.
+
+        * http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-disable-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-media-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-range-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-validation-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-vary-expected.txt:
+        * http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt:
+        * http/tests/cache/disk-cache/resources/cache-test.js:
+        (loadResourcesWithOptions):
+        (.):
+        (runTests):
+
 2015-08-13  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Reduce flakiness of inspector/indexeddb/requestDatabaseNames

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -25,6 +25,16 @@
 response headers: {"Status":"204","Last-Modified":"now(-1000)"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Status":"204","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"204","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"204","Last-Modified":"now(-1000)"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -19,6 +19,13 @@
 response headers: {"Status":"302","Location":"/","Cache-control":"max-age=100"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Status":"302","Location":"/","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"302","Location":"/","Cache-control":"max-age=100"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -43,6 +43,25 @@
 response headers: {"Status":"307","Last-Modified":"now(-1000)"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Status":"307"}
+response source: Network
+
+response headers: {"Status":"307","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"307","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"307","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Status":"307","Expires":"now(100)"}
+response source: Memory cache
+
+response headers: {"Status":"307","Last-Modified":"now(-1000)"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -25,6 +25,16 @@
 response headers: {"Status":"404","Last-Modified":"now(-1000)"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Status":"404","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"404","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"404","Last-Modified":"now(-1000)"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-disable-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-disable-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-disable-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -12,6 +12,10 @@
 response headers: {"Cache-control":"max-age=100"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
 Disabling cache
 --------Testing loads from disk cache--------
 response headers: {"Cache-control":"max-age=100"}
@@ -21,6 +25,10 @@
 response headers: {"Cache-control":"max-age=100"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
 Re-enabling cache
 --------Testing loads from disk cache--------
 response headers: {"Cache-control":"max-age=100"}
@@ -30,6 +38,10 @@
 response headers: {"Cache-control":"max-age=100"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-media-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-media-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-media-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -43,6 +43,25 @@
 response headers: {"Cache-control":"max-age=100","Content-Type":"audio/mp4"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=0","Content-Type":"text/plain"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Content-Type":"text/plain"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Content-Type":"video/mp4"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Content-Type":"video/mp4"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Content-Type":"audio/mp4"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Content-Type":"audio/mp4"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-range-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-range-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-range-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -53,6 +53,31 @@
 response source: Network
 response status: 416
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+response status: 200
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+response status: 200
+
+response headers: {"Cache-control":"max-age=100","Range":"bytes=2-4"}
+response source: Memory cache
+response status: 206
+
+response headers: {"Cache-control":"max-age=0","Range":"bytes=2-4"}
+response source: Network
+response status: 206
+
+response headers: {"Cache-control":"max-age=100","Range":"bytes=5-7"}
+response source: Memory cache
+response status: 416
+
+response headers: {"Cache-control":"max-age=0","Range":"bytes=5-7"}
+response source: Network
+response status: 416
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -195,6 +195,101 @@
 request headers: {"Cache-control":"no-cache, no-store, max-age=100"}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-store"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache, no-store"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-store, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-store, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache, no-store, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache, no-store, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"max-age=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache, max-age=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache, max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-store, max-age=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-store, max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0"}
+request headers: {"Cache-control":"no-cache, no-store, max-age=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"no-cache, no-store, max-age=100"}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -295,6 +295,151 @@
 request headers: {"Cache-control":"max-stale=100, max-age=100"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=0, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=0, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=0, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=0, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=100, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=100, max-age=0"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=100, max-age=0"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=100, max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=0, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=0, max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=0, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=0, max-age=100"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale, max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale, max-age=100"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+request headers: {"Cache-control":"max-stale=100, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100"}
+request headers: {"Cache-control":"max-stale=100, max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Age":"200"}
+request headers: {"Cache-control":"max-stale=100, max-age=100"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Age":"200"}
+request headers: {"Cache-control":"max-stale=100, max-age=100"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -14,6 +14,11 @@
 response's 'Expires' header is overriden by future date in 304 response
 response source: Memory cache after validation
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Expires":"now(0)","ETag":"match"}
+response's 'Expires' header is overriden by future date in 304 response
+response source: Memory cache after validation
+
 304 response included an 'Expires' header in the future, so we should not need to revalidate this time.
 --------Testing loads from disk cache--------
 response headers: {"Expires":"now(0)","ETag":"match"}
@@ -25,6 +30,11 @@
 response's 'Expires' header is overriden by future date in 304 response
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Expires":"now(0)","ETag":"match"}
+response's 'Expires' header is overriden by future date in 304 response
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -43,6 +43,25 @@
 response headers: {"Cache-control":"max-age=100","Content-Disposition":"attachment; filename=\"f.txt\""}
 response source: Memory cache
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: undefined
+response source: Network
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Content-Disposition":"attachment; filename=\"f.txt\""}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Content-Disposition":"attachment; filename=\"f.txt\""}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Content-Disposition":"attachment; filename=\"f.txt\""}
+response source: Memory cache
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -331,6 +331,169 @@
 response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"nomatch"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: undefined
+response source: Network
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache"}
+response source: Network
+
+response headers: {"ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, must-revalidate"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate"}
+response source: Network
+
+response headers: {"ETag":"match","Cache-control":"must-revalidate"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, must-revalidate","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Cache-control":"must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, must-revalidate","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
 Testing high priority resources
 
 --------Testing loads from disk cache--------
@@ -659,6 +822,169 @@
 response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"nomatch"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: undefined
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0, no-cache"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=100, no-cache"}
+response source: Disk cache
+
+response headers: {"ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"must-revalidate"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0, must-revalidate"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=100, must-revalidate"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate"}
+response source: Disk cache
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate"}
+response source: Disk cache
+
+response headers: {"ETag":"match","Cache-control":"must-revalidate"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, must-revalidate","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Cache-control":"must-revalidate"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, must-revalidate","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache, must-revalidate","ETag":"nomatch"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -493,6 +493,250 @@
 response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"nomatch"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: undefined
+response source: Network
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)"}
+response source: Network
+
+response headers: {"ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)","ETag":"match"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -493,6 +493,250 @@
 response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"nomatch"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: undefined
+response source: Network
+
+response headers: {"Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)"}
+response source: Network
+
+response headers: {"ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)","ETag":"match"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)","ETag":"match"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)","ETag":"match"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"match"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(0)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Expires":"now(100)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"max-age=0","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Expires":"now(100)","ETag":"nomatch"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-store","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(0)","Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(0)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Expires":"now(100)","Cache-control":"no-cache","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Expires":"now(100)","ETag":"nomatch"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -439,6 +439,223 @@
 request headers: {"Accept-Language":"unique()"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt	2015-08-14 14:08:59 UTC (rev 188468)
@@ -439,6 +439,223 @@
 request headers: {"Accept-Language":"unique()"}
 response source: Network
 
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"en"}
+response source: Network
+
+response headers: {"Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"match","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache after validation
+
+response headers: {"ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Memory cache
+
+response headers: {"Cache-control":"no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-store","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=0, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
+response headers: {"Cache-control":"max-age=100, no-cache","ETag":"nomatch","Vary":"Accept-Language"}
+request headers: {"Accept-Language":"unique()"}
+response source: Network
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js (188467 => 188468)


--- trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2015-08-14 14:08:59 UTC (rev 188468)
@@ -73,6 +73,7 @@
 {
     if (options["ClearMemoryCache"])
         internals.clearMemoryCache();
+    internals.setStrictRawResourceValidationPolicyDisabled(options["SubresourceValidationPolicy"]);
 
     var pendingCount = tests.length;
     for (var i = 0; i < tests.length; ++i) {
@@ -115,10 +116,14 @@
                 debug("--------Testing loads through memory cache (XHR behavior)--------");
                 loadResourcesWithOptions(tests, { }, function () {
                     printResults(tests);
-                    if (completionHandler)
-                        completionHandler();
-                    else
-                        finishJSTest();
+                    debug("--------Testing loads through memory cache (subresource behavior)--------");
+                    loadResourcesWithOptions(tests, { "SubresourceValidationPolicy": true }, function () {
+                        printResults(tests);
+                        if (completionHandler)
+                            completionHandler();
+                        else
+                            finishJSTest();
+                    });
                 });
             });
         }, 100);

Modified: trunk/Source/WebCore/ChangeLog (188467 => 188468)


--- trunk/Source/WebCore/ChangeLog	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/ChangeLog	2015-08-14 14:08:59 UTC (rev 188468)
@@ -1,3 +1,46 @@
+2015-08-13  Antti Koivisto  <[email protected]>
+
+        Cover memory cache subresource validation policy with cache tests
+        https://bugs.webkit.org/show_bug.cgi?id=147830
+
+        Reviewed by Alexey Proskuryakov.
+
+        Existing tests under http/tests/cache/disk-cache currently cover disk and XHR memory cache validation behaviors.
+        They can be extended to cover the regular subresource policy too.
+
+        Add window.internals API to disable CachedRawResource validation behavior. This makes XHR validate like
+        other resources and allows existing tests (that use XHR) to cover normal subresource policy .
+
+        Test results reveal some bugs. For example subresources in memory cache don't respect Vary header.
+
+        It is generally bad that we have a separate XHR-and-main-resource validation policy in memory cache. Network cache
+        doesn't have one.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clearTestingOverrides):
+        (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
+        * loader/FrameLoader.h:
+        (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
+        (WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
+        (WebCore::FrameLoader::setStrictRawResourceValidationPolicyDisabledForTesting):
+        (WebCore::FrameLoader::isStrictRawResourceValidationPolicyDisabledForTesting):
+        (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL):
+        * loader/cache/CachedRawResource.h:
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::setLoadFinishTime):
+        (WebCore::CachedResource::loadFinishTime):
+        (WebCore::CachedResource::canReuse): Deleted.
+
+            Made canReuse non-virtual and removed it from the base. Only CachedRawResource has implementation.
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::determineRevalidationPolicy):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setOverrideResourceLoadPriority):
+        (WebCore::Internals::setStrictRawResourceValidationPolicyDisabled):
+        (WebCore::Internals::clearMemoryCache):
+        * testing/Internals.h:
+
 2015-08-13  Tim Horton  <[email protected]>
 
         Performing a Lookup on wrapped text puts the popover arrow in the wrong place (off to the right)

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (188467 => 188468)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2015-08-14 14:08:59 UTC (rev 188468)
@@ -3467,6 +3467,7 @@
 {
     m_overrideCachePolicyForTesting = Nullopt;
     m_overrideResourceLoadPriorityForTesting = Nullopt;
+    m_isStrictRawResourceValidationPolicyDisabledForTesting = false;
 }
 
 void FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader(DocumentLoader& documentLoader, ShouldOpenExternalURLsPolicy propagatedPolicy)

Modified: trunk/Source/WebCore/loader/FrameLoader.h (188467 => 188468)


--- trunk/Source/WebCore/loader/FrameLoader.h	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/loader/FrameLoader.h	2015-08-14 14:08:59 UTC (rev 188468)
@@ -285,6 +285,9 @@
 
     void setOverrideCachePolicyForTesting(ResourceRequestCachePolicy policy) { m_overrideCachePolicyForTesting = policy; }
     void setOverrideResourceLoadPriorityForTesting(ResourceLoadPriority priority) { m_overrideResourceLoadPriorityForTesting = priority; }
+    void setStrictRawResourceValidationPolicyDisabledForTesting(bool disabled) { m_isStrictRawResourceValidationPolicyDisabledForTesting = disabled; }
+    bool isStrictRawResourceValidationPolicyDisabledForTesting() { return m_isStrictRawResourceValidationPolicyDisabledForTesting; }
+
     WEBCORE_EXPORT void clearTestingOverrides();
 
     const URL& provisionalLoadErrorBeingHandledURL() const { return m_provisionalLoadErrorBeingHandledURL; }
@@ -442,6 +445,7 @@
 
     Optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting;
     Optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting;
+    bool m_isStrictRawResourceValidationPolicyDisabledForTesting { false };
 
     URL m_previousURL;
     RefPtr<HistoryItem> m_requestedHistoryItem;

Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (188467 => 188468)


--- trunk/Source/WebCore/loader/cache/CachedRawResource.h	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h	2015-08-14 14:08:59 UTC (rev 188468)
@@ -46,6 +46,8 @@
 
     void clear();
 
+    bool canReuse(const ResourceRequest&) const;
+
 private:
     virtual void didAddClient(CachedResourceClient*) override;
     virtual void addDataBuffer(SharedBuffer&) override;
@@ -62,8 +64,6 @@
     virtual void switchClientsToRevalidatedResource() override;
     virtual bool mayTryReplaceEncodedData() const override { return m_allowEncodedDataReplacement; }
 
-    virtual bool canReuse(const ResourceRequest&) const override;
-
     const char* calculateIncrementalDataChunk(SharedBuffer*, unsigned& incrementalDataLength);
     void notifyClientsDataWasReceived(const char* data, unsigned length);
 

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (188467 => 188468)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2015-08-14 14:08:59 UTC (rev 188468)
@@ -252,8 +252,6 @@
     void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; }
     double loadFinishTime() const { return m_loadFinishTime; }
 
-    virtual bool canReuse(const ResourceRequest&) const { return true; }
-
 #if USE(FOUNDATION) || USE(SOUP)
     WEBCORE_EXPORT void tryReplaceEncodedData(SharedBuffer&);
 #endif

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (188467 => 188468)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2015-08-14 14:08:59 UTC (rev 188468)
@@ -696,8 +696,14 @@
         return Reload;
     }
 
-    if (!existingResource->canReuse(request))
-        return Reload;
+    // FIXME: We should use the same cache policy for all resource types. The raw resource policy is overly strict
+    //        while the normal subresource policy is too loose.
+    if (existingResource->isMainOrRawResource()) {
+        bool strictPolicyDisabled = frame()->loader().isStrictRawResourceValidationPolicyDisabledForTesting();
+        bool canReuseRawResource = strictPolicyDisabled || downcast<CachedRawResource>(*existingResource).canReuse(request);
+        if (!canReuseRawResource)
+            return Reload;
+    }
 
     // Conditional requests should have failed canReuse check.
     ASSERT(!request.isConditional());

Modified: trunk/Source/WebCore/testing/Internals.cpp (188467 => 188468)


--- trunk/Source/WebCore/testing/Internals.cpp	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/testing/Internals.cpp	2015-08-14 14:08:59 UTC (rev 188468)
@@ -514,6 +514,11 @@
     frame()->loader().setOverrideResourceLoadPriorityForTesting(stringToResourceLoadPriority(priority));
 }
 
+void Internals::setStrictRawResourceValidationPolicyDisabled(bool disabled)
+{
+    frame()->loader().setStrictRawResourceValidationPolicyDisabledForTesting(disabled);
+}
+
 void Internals::clearMemoryCache()
 {
     MemoryCache::singleton().evictResources();

Modified: trunk/Source/WebCore/testing/Internals.h (188467 => 188468)


--- trunk/Source/WebCore/testing/Internals.h	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/testing/Internals.h	2015-08-14 14:08:59 UTC (rev 188468)
@@ -97,6 +97,7 @@
     bool isStyleSheetLoadingSubresources(Element* link);
     void setOverrideCachePolicy(const String&);
     void setOverrideResourceLoadPriority(const String&);
+    void setStrictRawResourceValidationPolicyDisabled(bool);
 
     void clearMemoryCache();
     void pruneMemoryCacheToSize(unsigned size);

Modified: trunk/Source/WebCore/testing/Internals.idl (188467 => 188468)


--- trunk/Source/WebCore/testing/Internals.idl	2015-08-14 12:34:55 UTC (rev 188467)
+++ trunk/Source/WebCore/testing/Internals.idl	2015-08-14 14:08:59 UTC (rev 188468)
@@ -78,6 +78,7 @@
     long memoryCacheSize();
     void setOverrideCachePolicy(CachePolicy policy);
     void setOverrideResourceLoadPriority(ResourceLoadPriority priority);
+    void setStrictRawResourceValidationPolicyDisabled(boolean disabled);
 
     void clearPageCache();
     unsigned int pageCacheSize();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to