Fix AdsPageLoadMetricsObserverTest + RenderDocument for subframes.
See https://chromium.googlesource.com/chromium/src/+/HEAD/docs/render_document.md When RenderDocument for subframes is enabled, 2 tests fail: - AdsPageLoadMetricsObserverTest.HeavyAdCpuInterventionInBackground - AdsPageLoadMetricsObserverTest.HeavyAdNetworkInterventionInBackgrounded Failures can be seen in the CQ of this change which enables RD for subframes: - https://crrev.com/c/2241368/6 They fail because the timing changes and SendInterventionReport ends up being processed before FlushForTesting is called. At that point there is no quit closure and so the message is dropped. This is fixed by storing the message even if there is no quit closure. This then requires a fix for HeavyAdPolicyProvided because it reuses the same FrameRemoteTester for many tests and some messages from one iteration linger for the next. This flushes the pipe at the start of each iteration. Also added a SCOPED_TRACE to this loop so you know which test failed when one fails. Bug: 1064944 Change-Id: I67b38f48e562ba4ecd4fad25afdc58cfb18f2b8a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2500975 Auto-Submit: Fergal Daly <fergal@chromium.org> Reviewed-by:Eric Robinson <ericrobinson@chromium.org> Commit-Queue: Fergal Daly <fergal@chromium.org> Cr-Commit-Position: refs/heads/master@{#821701}
Showing
Please register or sign in to comment