blob: 1518a8ce9c7c042d546261569ba7de66ac3a2023 [file] [log] [blame]
This tests clearing the resource timing buffer during a resourcetimingbufferfull event.
WebKit should not hit a release assertion.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS performance.clearResourceTimings(); performance.getEntriesByType("resource").length is 0
performance.setResourceTimingBufferSize(2); fetchImages(0, 3)
PASS originalResources = performance.getEntriesByType("resource"); originalResources.length is 2
PASS originalResources[0].initiatorType is "css"
PASS new URL(originalResources[0].name).search is "?resource=0"
PASS originalResources[1].initiatorType is "css"
PASS new URL(originalResources[1].name).search is "?resource=1"
PASS resourcetimingbufferfullEventCount is 0
Inside resourcetimingbufferfull 1
performance.setResourceTimingBufferSize(10); fetchImages(3, 4)
PASS resourcesAfterShrinkingBuffer = performance.getEntriesByType("resource"); resourcesAfterShrinkingBuffer.length is 2
PASS resourcesAfterShrinkingBuffer[0] is originalResources[0]
PASS resourcesAfterShrinkingBuffer[1] is originalResources[1]
After resourcetimingbufferfull
PASS finalResources = performance.getEntriesByType("resource"); finalResources.length is 4
PASS resourcetimingbufferfullEventCount is 1
PASS finalResources[0] is originalResources[0]
PASS finalResources[1] is originalResources[1]
PASS finalResources[2].initiatorType is "css"
PASS new URL(finalResources[2].name).search is "?resource=2"
PASS finalResources[3].initiatorType is "css"
PASS new URL(finalResources[3].name).search is "?resource=3"
PASS successfullyParsed is true
TEST COMPLETE