Bug 24569: Add some cookies tests
authorDavid Kilzer <ddkilzer@webkit.org>
Tue, 19 May 2009 04:52:42 +0000 (04:52 +0000)
committerDavid Kilzer <ddkilzer@webkit.org>
Tue, 19 May 2009 04:52:42 +0000 (04:52 +0000)
commit8c84f014b411a4ee5b5942424ceda031f0fb56df
tree593e6edaa5f01561b49d04593a140850d085e747
parentaea7b3b499adcf4c229abbf9677da82a2c80cba6
    Bug 24569: Add some cookies tests

        <https://bugs.webkit.org/show_bug.cgi?id=24569>

LayoutTests:

        Reviewed and tweaked by David Kilzer.

        This modification adds a cookie framework to check setting cookies.
        It is a simple modification over the js test framework. It uses some XHRs and custom server-side script
        to set / get / clear cookies.

        It also adds some very basic tests to check that everything works.

        * http/tests/cookies: Added.
        * http/tests/cookies/multiple-cookies-expected.txt: Added.
        * http/tests/cookies/multiple-cookies.html: Added.
        * http/tests/cookies/resources: Added.
        * http/tests/cookies/resources/TEMPLATE.html: Copied from LayoutTests/fast/js/resources/TEMPLATE.html.
        * http/tests/cookies/resources/clearCookies.cgi: Added.
        * http/tests/cookies/resources/cookies-test-post.js: Copied from LayoutTests/fast/js/resources/js-test-post.js.
        * http/tests/cookies/resources/cookies-test-pre.js: Copied from LayoutTests/fast/js/resources/js-test-pre.js.
        (setCookies): Internal method to set a cookie (multiple cookies are not supported).
        (testCookies): Internal method to check if the cookie were set.

        (clearAllCookies): Used to clear all pre-existing cookies for this domain.
        (clearCookies): Used to clear the cookies set with cookiesShouldBe.
        (cookiesShouldBe): Used to set a cookie and check the "Cookie" header sent. It is inspired from shouldBe from the js test framework.

        * http/tests/cookies/resources/cookies-test-style.css: Copied from LayoutTests/fast/js/resources/js-test-style.css.
        * http/tests/cookies/resources/getCookies.cgi: Added.
        * http/tests/cookies/resources/multiple-cookies.js: Added.
        * http/tests/cookies/resources/setCookies.cgi: Added.
        * http/tests/cookies/resources/simple-cookies-expired.js: Added.
        * http/tests/cookies/resources/simple-cookies-max-age.js: Added.
        * http/tests/cookies/simple-cookies-expired-expected.txt: Added.
        * http/tests/cookies/simple-cookies-expired.html: Added.
        * http/tests/cookies/simple-cookies-max-age-expected.txt: Added.
        * http/tests/cookies/simple-cookies-max-age.html: Added.
        * platform/mac-tiger/Skipped: Added
        http/tests/cookies/simple-cookies-max-age.html since CFNetwork
        on Tiger doesn't support expiring cookies with Max-Age=0.

WebKitTools:

        Patch by David Kilzer.

        * Scripts/make-js-test-wrappers: Added regex to skip
        cookies-test-(post|pre).js files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/cookies/multiple-cookies-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cookies/multiple-cookies.html [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/TEMPLATE.html [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/clearCookies.cgi [new file with mode: 0755]
LayoutTests/http/tests/cookies/resources/cookies-test-post.js [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/cookies-test-pre.js [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/cookies-test-style.css [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/getCookies.cgi [new file with mode: 0755]
LayoutTests/http/tests/cookies/resources/multiple-cookies.js [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/setCookies.cgi [new file with mode: 0755]
LayoutTests/http/tests/cookies/resources/simple-cookies-expired.js [new file with mode: 0644]
LayoutTests/http/tests/cookies/resources/simple-cookies-max-age.js [new file with mode: 0644]
LayoutTests/http/tests/cookies/simple-cookies-expired-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cookies/simple-cookies-expired.html [new file with mode: 0644]
LayoutTests/http/tests/cookies/simple-cookies-max-age-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cookies/simple-cookies-max-age.html [new file with mode: 0644]
LayoutTests/platform/mac-tiger/Skipped
WebKitTools/ChangeLog
WebKitTools/Scripts/make-js-test-wrappers