FirstMeaningfulPaint: Ensure event is sent.

The FirstMeaningfulPaintDetector method |CheckNetworkStable| is called
whenever an active connection is removed.
If the number of connection is low enough and is stable for long enough,
the FirstMeaningfulPaint event will be sent. The current implementation
does nothing if the document has not been parsed yet.

In particular, for the main resource, this function is called when the
load is completed. When it happens, the document may not have been
parsed yet. It depends on how things are scheduled in blink. If there
are no other sub resources to load, |CheckNetworkStable()| will not be
called again and the FirstMeaningfulPaint will never be send.

I am working on https://crbug.com/831155. It modifies how things are
scheduled in Blink. Several tests related to this issue are failing:
* SessionRestorePageLoadMetricsBrowserTest.LoadingAfterSessionRestore
* SessionRestorePageLoadMetricsBrowserTest.MultipleSessionRestores
* SessionRestorePageLoadMetricsBrowserTest.MultipleTabsSessionRestore
* SessionRestorePageLoadMetricsBrowserTest.RestoreForeignTab

This CL fixes this issue by calling |CheckNetworkStable()| when the
document has been parsed.

Bug: 831155
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I22c814280087dffd99e2eb6c02918dc1b8201fea
Reviewed-on: https://chromium-review.googlesource.com/1064055
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559829}
4 files changed