Changeset 246440 in webkit


Ignore:
Timestamp:
Jun 14, 2019 1:10:23 PM (5 years ago)
Author:
wilander@apple.com
Message:

Move http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRunner.setAlwaysAcceptCookies()
https://bugs.webkit.org/show_bug.cgi?id=198863
<rdar://problem/47854589>

Unreviewed test gardening.

testRunner.setAlwaysAcceptCookies() is not working right (tracked
in rdar://problem/51757107). Therefore, we need to change
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
to make it work properly.

  • http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
  • http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246438 r246440  
     12019-06-14  John Wilander  <wilander@apple.com>
     2
     3        Move http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html off of testRunner.setAlwaysAcceptCookies()
     4        https://bugs.webkit.org/show_bug.cgi?id=198863
     5        <rdar://problem/47854589>
     6
     7        Unreviewed test gardening.
     8
     9        testRunner.setAlwaysAcceptCookies() is not working right (tracked
     10        in rdar://problem/51757107). Therefore, we need to change
     11        http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
     12        to make it work properly.
     13
     14        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
     15        * http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
     16
    1172019-06-14  Saam Barati  <sbarati@apple.com>
    218
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt

    r239966 r246440  
    1212Frame: '<!--frame1-->'
    1313--------
    14 Set cookie.
    15 
     14Should receive first-party cookie for localhost.
     15Did not receive cookie named 'firstPartyCookieIP'.
     16Received cookie named 'firstPartyCookieLocalhost'.
     17Did not receive cookie named 'thirdPartyCookie'.
     18Client-side document.cookie: firstPartyCookieLocalhost=localhost
    1619
    1720--------
    1821Frame: '<!--frame2-->'
    1922--------
    20 Should receive first-party cookie.
    21 Received cookie named 'firstPartyCookie'.
    22 Did not receive cookie named 'partitionedCookie'.
    23 Client-side document.cookie: firstPartyCookie=value
     23Redirect case 1, should receive first-party cookie for 127.0.0.1.
     24Received cookie named 'firstPartyCookieIP'.
     25Did not receive cookie named 'firstPartyCookieLocalhost'.
     26Did not receive cookie named 'thirdPartyCookie'.
     27Client-side document.cookie: firstPartyCookieIP=127.0.0.1
    2428
    2529--------
    2630Frame: '<!--frame3-->'
    2731--------
    28 Redirect case 1, should receive first-party cookie for 127.0.0.1.
    29 Received cookie named 'firstPartyCookie'.
    30 Did not receive cookie named 'partitionedCookie'.
    31 Client-side document.cookie: firstPartyCookie=127.0.0.1
     32Try to set third-party cookie for localhost in blocked mode.
     33
    3234
    3335--------
    3436Frame: '<!--frame4-->'
    3537--------
    36 Try to set third-party cookie in blocked mode.
    37 
     38Should receive no cookie.
     39Did not receive cookie named 'firstPartyCookieIP'.
     40Did not receive cookie named 'firstPartyCookieLocalhost'.
     41Did not receive cookie named 'thirdPartyCookie'.
     42Client-side document.cookie:
    3843
    3944--------
    4045Frame: '<!--frame5-->'
    4146--------
    42 Should receive no cookie.
    43 Did not receive cookie named 'firstPartyCookie'.
    44 Did not receive cookie named 'partitionedCookie'.
    45 Client-side document.cookie:
    46 
    47 --------
    48 Frame: '<!--frame6-->'
    49 --------
    5047Redirect case 2, should receive first-party cookie for 127.0.0.1.
    51 Received cookie named 'firstPartyCookie'.
    52 Did not receive cookie named 'partitionedCookie'.
    53 Client-side document.cookie: firstPartyCookie=127.0.0.1
     48Received cookie named 'firstPartyCookieIP'.
     49Did not receive cookie named 'firstPartyCookieLocalhost'.
     50Did not receive cookie named 'thirdPartyCookie'.
     51Client-side document.cookie: firstPartyCookieIP=127.0.0.1
  • trunk/LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html

    r239966 r246440  
    1515    const resourcePath = "/resourceLoadStatistics/resources";
    1616    const thirdPartyBaseUrl = thirdPartyOrigin + resourcePath;
    17     const firstPartyCookieName = "firstPartyCookie";
    18     const subPathToSetFirstPartyCookie = "/set-cookie.php?name=" + firstPartyCookieName + "&value=value";
    19     const partitionedCookieName = "partitionedCookie";
    20     const subPathToSetPartitionedCookie = "/set-cookie.php?name=" + partitionedCookieName + "&value=value";
    21     const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieName + "&name2=" + partitionedCookieName;
     17    const firstPartyCookieNamePrefix = "firstPartyCookie";
     18    const firstPartyCookieNameIP = firstPartyCookieNamePrefix + "IP";
     19    const firstPartyCookieNameLocalhost = firstPartyCookieNamePrefix + "Localhost";
     20    const thirdPartyCookieName = "thirdPartyCookie";
     21    const subPathToSetThirdPartyCookie = "/set-cookie.php?name=" + thirdPartyCookieName + "&value=value";
     22    const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieNameIP + "&name2=" + firstPartyCookieNameLocalhost + "&name3=" + thirdPartyCookieName;
    2223    const redirectChainUrl = thirdPartyOrigin + resourcePath + "/redirect.php?redirectTo=http://" + partitionHost + resourcePath + subPathToGetCookies;
    2324
     
    3536            case "#step1":
    3637                // Set first-party cookies for 127.0.0.1 and localhost.
    37                 document.location.hash = "step2";
    38                 document.cookie = firstPartyCookieName + "=127.0.0.1;path='/'";
    39                 if (window.testRunner)
    40                     testRunner.setAlwaysAcceptCookies(true);
    41                 openIframe(thirdPartyBaseUrl + subPathToSetFirstPartyCookie + "&message=Set cookie.", runTest);
     38                if (document.location.origin === thirdPartyOrigin) {
     39                    document.cookie = firstPartyCookieNameLocalhost + "=localhost;path='/'";
     40                    document.location.href = "http://127.0.0.1:8000/resourceLoadStatistics/remove-blocking-in-redirect.html#step2";
     41                } else {
     42                    document.cookie = firstPartyCookieNameIP + "=127.0.0.1;path='/'";
     43                    document.location.href = "http://localhost:8000/resourceLoadStatistics/remove-blocking-in-redirect.html#step1";
     44                }
    4245                break;
    4346            case "#step2":
    4447                // Check that the cookie gets sent for localhost under 127.0.0.1 since localhost is not prevalent.
    4548                document.location.hash = "step3";
    46                 if (window.testRunner)
    47                     testRunner.setAlwaysAcceptCookies(false);
    48                 openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive first-party cookie.", runTest);
     49                openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive first-party cookie for localhost.", runTest);
    4950                break;
    5051            case "#step3":
     
    6566                // Try to set partitioned cookie for localhost under 127.0.0.1.
    6667                document.location.hash = "step6";
    67                 openIframe(thirdPartyBaseUrl + subPathToSetPartitionedCookie + "&message=Try to set third-party cookie in blocked mode.", runTest);
     68                openIframe(thirdPartyBaseUrl + subPathToSetThirdPartyCookie + "&message=Try to set third-party cookie for localhost in blocked mode.", runTest);
    6869                break;
    6970            case "#step6":
Note: See TracChangeset for help on using the changeset viewer.