Fix sync potentially starting before spellcheck dictionary loaded

Sync datatypes usually implement some waiting logic, either in the sync
controller (old approach) or in the SyncableService (recommended
approach).

For spellcheck, it seems like the logic was missing altogether. This
can theoretically lead to weird situations like sync data being ignored
and overriden by an older local snapshot.

In practice, this should be extremely rare, because sync's startup is
artificially delayed, and even if it happened, the consequences would
rarely be user-noticeable (since local data and sync data are likely
to have converged earlier).

Nevertheless, let's implement this waiting logic for completeness,
which may also contribute to improved test flakiness.

Bug: 939329
Change-Id: Iaab745a8759c1f44da80fec8addf0f64364f8d53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511253
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Rachel Blum <groby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640723}
2 files changed