Changeset 90612 in webkit


Ignore:
Timestamp:
Jul 7, 2011 11:41:26 PM (13 years ago)
Author:
yutak@chromium.org
Message:

WebSocket: Clear cookies after test in httponly-cookie.pl
https://bugs.webkit.org/show_bug.cgi?id=64145

Reviewed by Kent Tamura.

This test leaks cookies, which would cause a test failure if we put
a copy of this test under http/tests/websocket/tests.

To avoid this issue, cookies should be removed before the test ends.

  • http/tests/websocket/tests/hixie76/httponly-cookie.pl:

After the test, send an XHR request to itself with a query parameter,
which erases cookies used in this test by setting "Max-Age=0".

Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90609 r90612  
     12011-07-07  Yuta Kitamura  <yutak@chromium.org>
     2
     3        WebSocket: Clear cookies after test in httponly-cookie.pl
     4        https://bugs.webkit.org/show_bug.cgi?id=64145
     5
     6        Reviewed by Kent Tamura.
     7
     8        This test leaks cookies, which would cause a test failure if we put
     9        a copy of this test under http/tests/websocket/tests.
     10
     11        To avoid this issue, cookies should be removed before the test ends.
     12
     13        * http/tests/websocket/tests/hixie76/httponly-cookie.pl:
     14        After the test, send an XHR request to itself with a query parameter,
     15        which erases cookies used in this test by setting "Max-Age=0".
     16
    1172011-07-07  Kent Tamura  <tkent@chromium.org>
    218
  • trunk/LayoutTests/http/tests/websocket/tests/hixie76/httponly-cookie.pl

    r90604 r90612  
    11#!/usr/bin/perl -wT
    22use strict;
     3
     4if ($ENV{"QUERY_STRING"} eq "clear=1") {
     5    print "Content-Type: text/plain\r\n";
     6    print "Set-Cookie: WK-websocket-test=0; Max-Age=0\r\n";
     7    print "Set-Cookie: WK-websocket-test-httponly=0; HttpOnly; Max-Age=0\r\n";
     8    print "\r\n";
     9    print "Cookies are cleared.";
     10    exit;
     11}
    312
    413print "Content-Type: text/html\r\n";
     
    2736}
    2837
     38function clearCookies()
     39{
     40    var xhr = new XMLHttpRequest();
     41    xhr.open("GET", "httponly-cookie.pl?clear=1", false);
     42    xhr.send(null);
     43}
     44
    2945var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/echo-cookie");
    3046ws.onopen = function() {
     
    3955    cookie = normalizeCookie(cookie);
    4056    shouldBe("cookie", '"WK-websocket-test-httponly=1; WK-websocket-test=1"');
     57    clearCookies();
    4158    finishJSTest();
    4259};
Note: See TracChangeset for help on using the changeset viewer.