Changeset 43851 in webkit


Ignore:
Timestamp:
May 18, 2009 9:52:42 PM (15 years ago)
Author:
ddkilzer@apple.com
Message:

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.
Location:
trunk
Files:
18 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r43834 r43851  
     12009-05-18  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed and tweaked by David Kilzer.
     4
     5        Bug 24569: Add some cookies tests
     6        <https://bugs.webkit.org/show_bug.cgi?id=24569>
     7
     8        This modification adds a cookie framework to check setting cookies.
     9        It is a simple modification over the js test framework. It uses some XHRs and custom server-side script
     10        to set / get / clear cookies.
     11
     12        It also adds some very basic tests to check that everything works.
     13
     14        * http/tests/cookies: Added.
     15        * http/tests/cookies/multiple-cookies-expected.txt: Added.
     16        * http/tests/cookies/multiple-cookies.html: Added.
     17        * http/tests/cookies/resources: Added.
     18        * http/tests/cookies/resources/TEMPLATE.html: Copied from LayoutTests/fast/js/resources/TEMPLATE.html.
     19        * http/tests/cookies/resources/clearCookies.cgi: Added.
     20        * http/tests/cookies/resources/cookies-test-post.js: Copied from LayoutTests/fast/js/resources/js-test-post.js.
     21        * http/tests/cookies/resources/cookies-test-pre.js: Copied from LayoutTests/fast/js/resources/js-test-pre.js.
     22        (setCookies): Internal method to set a cookie (multiple cookies are not supported).
     23        (testCookies): Internal method to check if the cookie were set.
     24
     25        (clearAllCookies): Used to clear all pre-existing cookies for this domain.
     26        (clearCookies): Used to clear the cookies set with cookiesShouldBe.
     27        (cookiesShouldBe): Used to set a cookie and check the "Cookie" header sent. It is inspired from shouldBe from the js test framework.
     28
     29        * http/tests/cookies/resources/cookies-test-style.css: Copied from LayoutTests/fast/js/resources/js-test-style.css.
     30        * http/tests/cookies/resources/getCookies.cgi: Added.
     31        * http/tests/cookies/resources/multiple-cookies.js: Added.
     32        * http/tests/cookies/resources/setCookies.cgi: Added.
     33        * http/tests/cookies/resources/simple-cookies-expired.js: Added.
     34        * http/tests/cookies/resources/simple-cookies-max-age.js: Added.
     35        * http/tests/cookies/simple-cookies-expired-expected.txt: Added.
     36        * http/tests/cookies/simple-cookies-expired.html: Added.
     37        * http/tests/cookies/simple-cookies-max-age-expected.txt: Added.
     38        * http/tests/cookies/simple-cookies-max-age.html: Added.
     39        * platform/mac-tiger/Skipped: Added
     40        http/tests/cookies/simple-cookies-max-age.html since CFNetwork
     41        on Tiger doesn't support expiring cookies with Max-Age=0.
     42
    1432009-05-18  David Kilzer  <ddkilzer@apple.com>
    244
  • trunk/LayoutTests/platform/mac-tiger/Skipped

    r43762 r43851  
    4444# New results needed after r43759, see <https://bugs.webkit.org/show_bug.cgi?id=25816>
    4545fast/text/international/thai-baht-space.html
     46
     47# <rdar://problem/5524766> Set-Cookie header field (RFC 2109) not supported correctly (15128)
     48# Tiger would need a new CFNetwork to support expiration of cookies using "Max-Age=0"
     49http/tests/cookies/simple-cookies-max-age.html
  • trunk/WebKitTools/ChangeLog

    r43844 r43851  
     12009-05-18  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Bug 24569: Add some cookies tests
     4
     5        <https://bugs.webkit.org/show_bug.cgi?id=24569>
     6
     7        Patch by David Kilzer.
     8
     9        * Scripts/make-js-test-wrappers: Added regex to skip
     10        cookies-test-(post|pre).js files.
     11
    1122009-05-18  Kevin Ollivier  <kevino@theolliviers.com>
    213
  • trunk/WebKitTools/Scripts/make-js-test-wrappers

    r43820 r43851  
    8989    for my $file (@files) {
    9090        next if $file =~ /js-test-.*\.js$/;
     91        next if $file =~ /cookies-test-(post|pre)\.js$/;
    9192        next if $file =~ /standalone-.*\.js$/;
    9293        next if $file =~ /SVGTestCase\.js/;
Note: See TracChangeset for help on using the changeset viewer.