diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index e9b7fdab4f1a..df6d2ff7304c 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2018-03-19 Brady Eidson + + Add a layout test verifying AppCache resource fetches have the document's cookie in place. + https://bugs.webkit.org/show_bug.cgi?id=183757 + + Reviewed by Alex Christensen. + + * http/tests/appcache/document-cookie-expected.txt: Added. + * http/tests/appcache/document-cookie.php: Added. + * http/tests/appcache/resources/cookie-protected-script.php: Added. + * http/tests/appcache/resources/document-cookie.manifest: Added. + 2018-03-19 Chris Dumez Make policy decisions asynchronous diff --git a/LayoutTests/http/tests/appcache/document-cookie-expected.txt b/LayoutTests/http/tests/appcache/document-cookie-expected.txt new file mode 100644 index 000000000000..02235e65a530 --- /dev/null +++ b/LayoutTests/http/tests/appcache/document-cookie-expected.txt @@ -0,0 +1,3 @@ +CONSOLE MESSAGE: line 1: ApplicationCache is deprecated. Please use ServiceWorkers instead. +This tests that cookies set on the main document are used when accessing resources in the manifest. +PASSED: Cookie is set to 'bar' diff --git a/LayoutTests/http/tests/appcache/document-cookie.php b/LayoutTests/http/tests/appcache/document-cookie.php new file mode 100644 index 000000000000..17e15e382ac3 --- /dev/null +++ b/LayoutTests/http/tests/appcache/document-cookie.php @@ -0,0 +1,28 @@ + + + +
This tests that cookies set on the main document are used when accessing resources in the manifest.
+
Not run yet
+ + diff --git a/LayoutTests/http/tests/appcache/resources/cookie-protected-script.php b/LayoutTests/http/tests/appcache/resources/cookie-protected-script.php new file mode 100644 index 000000000000..376312451c12 --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/cookie-protected-script.php @@ -0,0 +1,18 @@ +';"; +} + +?> + +if (cookieVal == "bar") + document.getElementById("result").innerHTML = "PASSED: Cookie is set to 'bar'"; +else + document.getElementById("result").innerHTML = "FAILED: Cookie should be 'bar', is set to '" + cookieVal + "'"; + +if (window.testRunner) + testRunner.notifyDone(); diff --git a/LayoutTests/http/tests/appcache/resources/document-cookie.manifest b/LayoutTests/http/tests/appcache/resources/document-cookie.manifest new file mode 100644 index 000000000000..013566c8907a --- /dev/null +++ b/LayoutTests/http/tests/appcache/resources/document-cookie.manifest @@ -0,0 +1,4 @@ +CACHE MANIFEST +/appcache/resources/cookie-protected-script.php +NETWORK: +/favicon.ico