Chromium Code Reviews
Description[Sync] Make EnableDisableSingleClientTest more robust.
EnableDisableSingleClientTest's tests enable or disable a type, and
then go verify that the root node was or was not present. This doesn't
work for USS, as USS doesn't create root nodes. So ever time we migrate
a USS type we have to update this file. However, this was a difficult
task because of the way it was set up. Full or hard coded rules about
relationships, and dependent on specific orderings of ModelType. The
most egregious violation being it would call enable/disable on non-user
selectable types, this would no-op, and then it'd verify it had the
correct affect, because typically these grouped types are preceded by
their corresponding user selectable type, and this test went through
the types in order.
To fix this, we start by making the test harness return false (failure)
if you try to enable/disable a non-selectable type. This in turns means
that EnableDisableSingleClientTest's cases need to understand some of
this type group mapping. So SyncPrefs was updated to expose
ResolvePrefGroups to allow intelligent tests. Not only does this allow
us to remove most hard coded type rules, but we are also able to test
on a more precise level, knowing typically exactly which types should
change as a result of an enable/disable. The main caveat being types
that are mapped to by multiple selectable types, which we're slightly
less strictly testing when they change.
Also updated test to guess that any new type of syncer::PRINTERS or
later will be USS. This strives to reduce the pain of adding new types,
although it is a risk in that the logic is fragile.
BUG=686172
Review-Url: https://codereview.chromium.org/2670903002
Cr-Commit-Position: refs/heads/master@{#448085}
Committed: https://chromium.googlesource.com/chromium/src/+/d09c38982b3b999ecfa67acfb8018d0b198bc4bd
Patch Set 1 #
Total comments: 10
Patch Set 2 : Updates for Patrick. #
Messages
Total messages: 23 (15 generated)
|
|||||||||||||||||||||||||||||||||||||