NavigationPredictor: Fix ClickAnchorElementOffTheRecord test
This CL fixes ClickAnchorElementOffTheRecord test in NavigationPredictorBrowserTest. The test navigates an incognito browser to "/simple_page_with_anchors.html", makes the browser click one of the anchor links, and then checks PageLoad UKMs. Before this CL, the test checks the UKM recorder immediately after clicking the anchor link. This is not correct because PageLoad metrics are recorded when the page navigates away or becomes hidden (see callers of UkmPageLoadMetricsObserver::RecordPageLoadMetrics()). This means no UKMs are recorded regardless of the test configuration. After this CL, the test ensures that the browser navigates to the linked page before checking the UKM recorder. Also, this CL removes comments about cache interaction because this test doesn't refer to the cache. Bug: n/a Change-Id: Iecbe502718828f3dcb9bbbec811810ba66bc2d62 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2245428 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Ryan Sturm <ryansturm@chromium.org> Cr-Commit-Position: refs/heads/master@{#779625}
Showing
Please register or sign in to comment