The tests for ResourceLoadStatistics are inherently flaky, because they expose the algorithm to various inputs, then immediately attempts to read back state even though the statistics are being processed in a background queue. The test harness needs to be revised to work more like the scrolling tests, where a callback is registered to be called when the work is complete.
<rdar://problem/32028373>
Created attachment 311574 [details] Patch
Comment on attachment 311574 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311574&action=review > Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp:146 > + RunLoop::main().dispatch([this, protectedThis = makeRef(*this)] () mutable { > + WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed(); > + }); It's not obvious why `this` has to be captured here since the lambda calls a static function.
Comment on attachment 311574 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311574&action=review >> Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp:146 >> + }); > > It's not obvious why `this` has to be captured here since the lambda calls a static function. Good point. I'll remove that and double-check before landing.
Committed r217606: <http://trac.webkit.org/changeset/217606>