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

Issue 2328393002: [Sync] Add a sanity integration test for USS. (Closed)

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

Description

[Sync] Add a sanity integration test for USS. This integration test overwrites the PREFERENCES data type to use a fake ModelTypeService implementation. This is done using two new static calls: - ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest to force PREFERENCES to be registered as a USS type (with a ModelTypeController). - ProfileSyncServiceFactory::SetSyncClientFactoryForTest to override the SyncClient that the real ProfileSyncService uses so that the ModelTypeService can be injected. Additionally, this change fixes an issue with deletions under USS that was uncovered while writing it. The specifics used for a deleted entity must have ByteSize() == 0 for it to be detected as a deletion, but we were setting it to the one sent by the server, which has ByteSize() == 4 so the model type can be extracted from it. BUG=643269 Committed: https://crrev.com/a1d69879d0c74f5edae8cb1a942ff6538fe398cb Cr-Commit-Position: refs/heads/master@{#418404}

Patch Set 1 #

Patch Set 2 : Fix unittests. #

Patch Set 3 : Ensure static changes don't persist between tests. #

Total comments: 43

Patch Set 4 : Missed a file... #

Patch Set 5 : Fix FakeServer instead of changing worker. #

Patch Set 6 : Fix Android. #

Patch Set 7 : Address comments + fix tests. #

Patch Set 8 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+335 lines, -62 lines) Patch
M chrome/browser/sync/profile_sync_service_factory.h View 4 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_factory.cc View 1 2 3 4 5 6 7 2 chunks +16 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
A chrome/browser/sync/test/integration/two_client_uss_sync_test.cc View 1 2 3 4 5 6 1 chunk +195 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M components/browser_sync/browser/profile_sync_components_factory_impl.h View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M components/browser_sync/browser/profile_sync_components_factory_impl.cc View 1 2 3 4 2 chunks +17 lines, -3 lines 0 comments Download
M components/sync/engine_impl/model_type_worker.cc View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download
M components/sync/engine_impl/worker_entity_tracker.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/test/fake_server/android/fake_server_helper_android.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M components/sync/test/fake_server/bookmark_entity.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/sync/test/fake_server/fake_server.cc View 1 2 3 4 5 6 13 chunks +20 lines, -18 lines 0 comments Download
M components/sync/test/fake_server/fake_server_entity.h View 1 2 3 4 3 chunks +11 lines, -4 lines 0 comments Download
M components/sync/test/fake_server/fake_server_entity.cc View 1 2 3 4 5 6 3 chunks +11 lines, -9 lines 0 comments Download
M components/sync/test/fake_server/permanent_entity.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M components/sync/test/fake_server/tombstone_entity.h View 1 2 3 4 2 chunks +6 lines, -2 lines 0 comments Download
M components/sync/test/fake_server/tombstone_entity.cc View 1 2 3 4 1 chunk +9 lines, -4 lines 0 comments Download
M components/sync/test/fake_server/unique_client_entity.h View 1 2 3 4 2 chunks +1 line, -2 lines 0 comments Download
M components/sync/test/fake_server/unique_client_entity.cc View 1 2 3 4 4 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 44 (34 generated)
maxbogue
Hey Pavel + Sky, PTAL! I'm aware that the static overrides are a bit messy, ...
4 years, 3 months ago (2016-09-12 19:03:11 UTC) #10
skym
Sorry all my comments are on PS#3 https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/profile_sync_service_factory.cc File chrome/browser/sync/profile_sync_service_factory.cc (right): https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/profile_sync_service_factory.cc#newcode173 chrome/browser/sync/profile_sync_service_factory.cc:173: if (!client_factory_) ...
4 years, 3 months ago (2016-09-12 19:57:50 UTC) #15
skym
https://codereview.chromium.org/2328393002/diff/40001/components/sync/engine_impl/model_type_worker.cc File components/sync/engine_impl/model_type_worker.cc (right): https://codereview.chromium.org/2328393002/diff/40001/components/sync/engine_impl/model_type_worker.cc#newcode445 components/sync/engine_impl/model_type_worker.cc:445: // Fall back to iterative search by id. On ...
4 years, 3 months ago (2016-09-12 19:59:31 UTC) #16
maxbogue
https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/profile_sync_service_factory.cc File chrome/browser/sync/profile_sync_service_factory.cc (right): https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/profile_sync_service_factory.cc#newcode173 chrome/browser/sync/profile_sync_service_factory.cc:173: if (!client_factory_) { On 2016/09/12 19:57:49, skym wrote: > ...
4 years, 3 months ago (2016-09-13 03:44:55 UTC) #25
skym
lgtm https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc File chrome/browser/sync/test/integration/two_client_uss_sync_test.cc (right): https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc#newcode160 chrome/browser/sync/test/integration/two_client_uss_sync_test.cc:160: static bool WaitForKeyPresent(TestModelTypeService* model, On 2016/09/13 03:44:54, maxbogue ...
4 years, 3 months ago (2016-09-13 15:54:32 UTC) #28
pavely
lgtm
4 years, 3 months ago (2016-09-13 19:04:11 UTC) #33
maxbogue
https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc File chrome/browser/sync/test/integration/two_client_uss_sync_test.cc (right): https://codereview.chromium.org/2328393002/diff/40001/chrome/browser/sync/test/integration/two_client_uss_sync_test.cc#newcode160 chrome/browser/sync/test/integration/two_client_uss_sync_test.cc:160: static bool WaitForKeyPresent(TestModelTypeService* model, On 2016/09/13 15:54:32, skym wrote: ...
4 years, 3 months ago (2016-09-13 19:15:26 UTC) #36
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/2328393002/140001
4 years, 3 months ago (2016-09-13 23:09:47 UTC) #41
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 3 months ago (2016-09-13 23:15:25 UTC) #42
commit-bot: I haz the power
4 years, 3 months ago (2016-09-13 23:17:13 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/a1d69879d0c74f5edae8cb1a942ff6538fe398cb
Cr-Commit-Position: refs/heads/master@{#418404}

Powered by Google App Engine
This is Rietveld 408576698