Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Issue 2670903002: [Sync] Make EnableDisableSingleClientTest more robust. (Closed)

Created:
3 years, 10 months ago by skym
Modified:
3 years, 10 months ago
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -132 lines) Patch
M chrome/browser/sync/test/integration/enable_disable_test.cc View 1 2 chunks +157 lines, -127 lines 0 comments Download
M chrome/browser/sync/test/integration/profile_sync_service_harness.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M components/sync/base/sync_prefs.h View 2 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 23 (15 generated)
skym
PTAL
3 years, 10 months ago (2017-02-02 20:50:17 UTC) #6
Patrick Noland
https://codereview.chromium.org/2670903002/diff/1/chrome/browser/sync/test/integration/enable_disable_test.cc File chrome/browser/sync/test/integration/enable_disable_test.cc (right): https://codereview.chromium.org/2670903002/diff/1/chrome/browser/sync/test/integration/enable_disable_test.cc#newcode37 chrome/browser/sync/test/integration/enable_disable_test.cc:37: void VerifyExistence(UserShare* user_share, Can you give the VerifyExistence functions ...
3 years, 10 months ago (2017-02-02 22:11:37 UTC) #9
skym
https://codereview.chromium.org/2670903002/diff/1/chrome/browser/sync/test/integration/enable_disable_test.cc File chrome/browser/sync/test/integration/enable_disable_test.cc (right): https://codereview.chromium.org/2670903002/diff/1/chrome/browser/sync/test/integration/enable_disable_test.cc#newcode37 chrome/browser/sync/test/integration/enable_disable_test.cc:37: void VerifyExistence(UserShare* user_share, On 2017/02/02 22:11:37, Patrick Noland wrote: ...
3 years, 10 months ago (2017-02-02 23:37:52 UTC) #11
Patrick Noland
lgtm
3 years, 10 months ago (2017-02-03 00:12:41 UTC) #13
skym
Adding max for committer lgtm.
3 years, 10 months ago (2017-02-03 00:18:17 UTC) #15
maxbogue
rs lgtm
3 years, 10 months ago (2017-02-03 01:09:03 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2670903002/20001
3 years, 10 months ago (2017-02-03 21:28:17 UTC) #20
commit-bot: I haz the power
3 years, 10 months ago (2017-02-03 22:09:44 UTC) #23
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/d09c38982b3b999ecfa67acfb801...

Powered by Google App Engine
This is Rietveld 408576698