Changeset 167601 in webkit


Ignore:
Timestamp:
Apr 21, 2014 11:55:14 AM (10 years ago)
Author:
ap@apple.com
Message:

http/tests/cache/subresource-failover-to-network.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131936

Reviewed by Brady Eidson.

The test was racy, because it was unintentionally queuing TestRunner operations
twice. Also, it failed to clean up its cookie.

Rewrote to not use TestRunner queuing, making the test work in browser.

  • http/tests/cache/resources/subresource-failover-to-network.cgi:
  • http/tests/cache/subresource-failover-to-network.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167597 r167601  
     12014-04-21  Alexey Proskuryakov  <ap@apple.com>
     2
     3        http/tests/cache/subresource-failover-to-network.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=131936
     5
     6        Reviewed by Brady Eidson.
     7
     8        The test was racy, because it was unintentionally queuing TestRunner operations
     9        twice. Also, it failed to clean up its cookie.
     10
     11        Rewrote to not use TestRunner queuing, making the test work in browser.
     12
     13        * http/tests/cache/resources/subresource-failover-to-network.cgi:
     14        * http/tests/cache/subresource-failover-to-network.html:
     15
    1162014-04-21  David Hyatt  <hyatt@apple.com>
    217
  • trunk/LayoutTests/http/tests/cache/resources/subresource-failover-to-network.cgi

    r51798 r167601  
    77try {
    88  var result = document.cookie.split(';')[0].split('=')[1];
    9   document.cookie = "result=PASS"; // for next time
    109
    1110  var r = new XMLHttpRequest();
     
    1615  document.write(e);
    1716}
     17if (!sessionStorage.subresourceFailoverToNetworkCGILoadedBefore) {
     18  sessionStorage.subresourceFailoverToNetworkCGILoadedBefore = true;
     19  document.cookie = "subresourceFailoverToNetwork=PASS"; // for next time
     20  history.back();
     21} else {
     22  sessionStorage.removeItem("subresourceFailoverToNetworkLoadedBefore");
     23  sessionStorage.removeItem("subresourceFailoverToNetworkCGILoadedBefore");
     24  document.cookie = "subresourceFailoverToNetwork=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";
     25  if (window.testRunner)
     26    testRunner.notifyDone();
     27}
    1828</script>
    1929EOF
  • trunk/LayoutTests/http/tests/cache/subresource-failover-to-network.html

    r120167 r167601  
    11<body>
    22<script>
    3   if ("testRunner" in window) {
    4     testRunner.dumpAsText();
     3function test() {
     4  if (!sessionStorage.subresourceFailoverToNetworkLoadedBefore) {
     5    if (window.testRunner) {
     6      testRunner.dumpAsText();
     7      testRunner.waitUntilDone();
     8    }
     9    sessionStorage.subresourceFailoverToNetworkLoadedBefore = true;
    510
    6     document.cookie = "result=FAIL"
     11    document.cookie = "subresourceFailoverToNetwork=FAIL";
    712
    813    // The results of the form submission is a page that performs a non-
     
    1116    // network and not being restricted to loading from the cache (as the main
    1217    // page is).
    13     testRunner.queueLoadingScript("document.forms[0].submit()");
    14     testRunner.queueBackNavigation(1);
    15     testRunner.queueForwardNavigation(1);
    16   }
     18    setTimeout( function() { document.forms[0].submit(); }, 0);
     19  } else
     20    history.forward();
     21}
     22
     23onload = test;
    1724</script>
    1825<form method="POST" action="resources/subresource-failover-to-network.cgi" enctype="multipart/form-data">
     
    2835subresources (including XMLHttpRequest instances) do not inherit this cache
    2936policy.
     37<p>
     38This test doesn't work in browser, because it expects page cache to be disabled.
    3039</body>
Note: See TracChangeset for help on using the changeset viewer.