Changeset 252067 in webkit


Ignore:
Timestamp:
Nov 5, 2019 11:53:40 AM (4 years ago)
Author:
Devin Rousso
Message:

Layout test http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html is a flakey failure
https://bugs.webkit.org/show_bug.cgi?id=203841
<rdar://problem/51752151>

Reviewed by Brian Burg.

  • http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html:

Rewrite the test so it actually waits for the resource response information to be received
in the frontend before testing any information about the resource, as the response is what
contains the status code and source. Previously, we would only wait for the inspected page
to finish loading, which did guarantee that the inspector frontend at least knew about the
resource being loaded, but not necessarily that it had been told about the response.

Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252066 r252067  
     12019-11-05  Devin Rousso  <drousso@apple.com>
     2
     3        Layout test http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html is a flakey failure
     4        https://bugs.webkit.org/show_bug.cgi?id=203841
     5        <rdar://problem/51752151>
     6
     7        Reviewed by Brian Burg.
     8
     9        * http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html:
     10        Rewrite the test so it actually waits for the resource response information to be received
     11        in the frontend before testing any information about the resource, as the response is what
     12        contains the status code and source. Previously, we would only wait for the inspected page
     13        to finish loading, which did guarantee that the inspector frontend at least knew about the
     14        resource being loaded, but not necessarily that it had been told about the response.
     15
    1162019-11-05  Daniel Bates  <dabates@apple.com>
    217
  • trunk/LayoutTests/http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html

    r236766 r252067  
    66<script src="../resources/inspector-test.js"></script>
    77<script>
    8 TestPage.dispatchEventToFrontend("LoadComplete");
    9 
    108function test()
    119{
     
    1614            name, description,
    1715            test(resolve, reject) {
    18                 InspectorTest.reloadPage({ignoreCache, revalidateAllResources: true});
    19                 InspectorTest.awaitEvent("LoadComplete").then((event) => {
    20                     let resource = null;
    21                     for (let item of WI.networkManager.mainFrame.resourceCollection) {
    22                         if (pattern.test(item.url)) {
    23                             resource = item;
    24                             break;
    25                         }
    26                     }
    27                     if (!resource) {
    28                         InspectorTest.fail("Failed to find specific resource.");
    29                         reject();
     16                let listener = WI.Resource.addEventListener(WI.Resource.Event.ResponseReceived, (event) => {
     17                    let resource = event.target;
     18                    if (!pattern.test(resource.url))
    3019                        return;
    31                     }
     20
    3221                    InspectorTest.expectThat(resource instanceof WI.Resource, "Resource should exist.");
    3322                    InspectorTest.expectEqual(resource.statusCode, statusCode, `statusCode should be ${statusCode}`);
    3423                    InspectorTest.expectEqual(resource.responseSource, responseSource, `responseSource should be ${String(responseSource)}`);
    35                 }).then(resolve, reject);
     24
     25                    WI.Resource.removeEventListener(WI.Resource.Event.ResponseReceived, listener);
     26                    resolve();
     27                });
     28
     29                InspectorTest.reloadPage({ignoreCache, revalidateAllResources: true});
    3630            }
    3731        });
Note: See TracChangeset for help on using the changeset viewer.