This fixes the flakiness of the test caused by an asynchronous process. It also
adds a helper function to components/prefs to wait for a specific pref value to
be set.
Fixed: 1028765
Change-Id: I23636d9a19c6db1db4fe01257f13a162007ad5c2
Bug: 1028765
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939488
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720137}