Changeset 252067 in webkit
- Timestamp:
- Nov 5, 2019 11:53:40 AM (4 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252066 r252067 1 2019-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 1 16 2019-11-05 Daniel Bates <dabates@apple.com> 2 17 -
trunk/LayoutTests/http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
r236766 r252067 6 6 <script src="../resources/inspector-test.js"></script> 7 7 <script> 8 TestPage.dispatchEventToFrontend("LoadComplete");9 10 8 function test() 11 9 { … … 16 14 name, description, 17 15 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)) 30 19 return; 31 } 20 32 21 InspectorTest.expectThat(resource instanceof WI.Resource, "Resource should exist."); 33 22 InspectorTest.expectEqual(resource.statusCode, statusCode, `statusCode should be ${statusCode}`); 34 23 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}); 36 30 } 37 31 });
Note: See TracChangeset
for help on using the changeset viewer.