Changeset 262006 in webkit


Ignore:
Timestamp:
May 21, 2020 9:16:41 AM (4 years ago)
Author:
Kate Cheney
Message:

Some http/tests/in-app-browser-privacy/ tests are timing out or failing
https://bugs.webkit.org/show_bug.cgi?id=212176
<rdar://problem/63452877>

Reviewed by Maciej Stachowiak.

These tests rely on a new network session load for each test resource.
When run in iterations, caching occurs, and the resource does not get
a new network session. This patch adds a random decoration value and
reloads each resource to ensure it is not cached.

  • http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html:
  • http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html:
  • http/tests/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261997 r262006  
     12020-05-21  Kate Cheney  <katherine_cheney@apple.com>
     2
     3        Some http/tests/in-app-browser-privacy/ tests are timing out or failing
     4        https://bugs.webkit.org/show_bug.cgi?id=212176
     5        <rdar://problem/63452877>
     6
     7        Reviewed by Maciej Stachowiak.
     8
     9        These tests rely on a new network session load for each test resource.
     10        When run in iterations, caching occurs, and the resource does not get
     11        a new network session. This patch adds a random decoration value and
     12        reloads each resource to ensure it is not cached.
     13
     14        * http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html:
     15        * http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html:
     16        * http/tests/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html:
     17
    1182020-05-21  Kenneth Russell  <kbr@chromium.org>
    219
  • trunk/LayoutTests/http/tests/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html

    r260900 r262006  
    1010    description("Tests that an app-bound domain has an app-bound session.");
    1111    jsTestIsAsync = true;
    12 
     12   
    1313    function runTest() {
    14         if (!testRunner.hasAppBoundSession()) {
    15             testFailed("Origin did not start with app-bound session.");
    16             finishJSTest();
     14        if (document.location.hash == "") {
     15            // Load this test again with a random dummy value to avoid caching.
     16            document.location.href = "http://127.0.0.1:8000/in-app-browser-privacy/app-bound-domain-gets-app-bound-session.html?dummyParam=" + Math.random() + "#step1";
    1717        } else {
    18             testPassed("Origin has app-bound session.");
    19             finishJSTest();
     18            if (!testRunner.hasAppBoundSession()) {
     19                testFailed("Origin does not have app-bound session.");
     20                finishJSTest();
     21            } else {
     22                testPassed("Origin has app-bound session.");
     23                finishJSTest();
     24            }
    2025        }
    2126    }
  • trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html

    r260900 r262006  
    1212
    1313    function runTest() {
    14         if (testRunner.hasAppBoundSession()) {
    15             testFailed("Origin started with app-bound session.");
    16             finishJSTest();
     14        if (document.location.hash == "") {
     15            // Load this test again with a random dummy value to avoid caching.
     16            document.location.href = "http://127.0.0.1:8000/in-app-browser-privacy/non-app-bound-domain-does-not-get-app-bound-session.html?dummyParam=" + Math.random() + "#step1";
    1717        } else {
    18             testPassed("Origin has non-app-bound session.");
    19             finishJSTest();
     18            if (testRunner.hasAppBoundSession()) {
     19                testFailed("Origin started with app-bound session.");
     20                finishJSTest();
     21            } else {
     22                testPassed("Origin has non-app-bound session.");
     23                finishJSTest();
     24            }
    2025        }
    2126    }
  • trunk/LayoutTests/http/tests/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html

    r261620 r262006  
    2626    function loadFrame() {
    2727        let iframeElement = document.createElement("iframe");
    28         iframeElement.src = "http://localhost:8000/in-app-browser-privacy/resources/non-app-bound-iframe.html";
     28        iframeElement.src = "http://localhost:8000/in-app-browser-privacy/resources/non-app-bound-iframe.html?dummyParam" + Math.random();
    2929        document.body.appendChild(iframeElement);
    3030    }
    3131   
    3232    function runTest() {
    33         if (!testRunner.hasAppBoundSession()) {
    34             testFailed("Origin did not start with app-bound session.");
     33        if (document.location.hash == "") {
     34            // Load this test again with a random dummy value to avoid caching.
     35            document.location.href = "http://127.0.0.1:8000/in-app-browser-privacy/non-app-bound-iframe-under-app-bound-domain-is-app-bound.html?dummyParam=" + Math.random() + "#step1";
    3536        } else {
    36             testPassed("Origin has app-bound session.");
    37            
    38             // Clear the app-bound session to make sure the iframe load creates
    39             // a new one.
    40             testRunner.clearAppBoundSession();
    41             loadFrame();
     37            if (!testRunner.hasAppBoundSession()) {
     38                testFailed("Origin did not start with app-bound session.");
     39                finishJSTest();
     40            } else {
     41                testPassed("Origin has app-bound session.");
     42
     43                // Clear the app-bound session to make sure the iframe load creates
     44                // a new one.
     45                testRunner.clearAppBoundSession();
     46                loadFrame();
     47            }
    4248        }
    4349    }
Note: See TracChangeset for help on using the changeset viewer.