SyncApiComponentFactoryMock is no longer available upstream, and
FakeSyncApiComponentFactory should be used instead, along with
some other smaller changes derived from other recent related
changes upstream.
This patch adapts the unit tests to maintain the same behaviour
while using the new fake-based APIs, instead of the old ones.
[TODO] BraveProfileSyncServiceTest.NoIdentityManagerCalls is not
completely migrated yet, we still need to migrate mock-based check
EXPECT_CALL(*engine(), OnCookieJarChanged(_, _)).Times(0)
Chromium changes:
https://chromium.googlesource.com/chromium/src.git/+/dcdd123f162664500d3976cdcb8e575ad8711bcfhttps://chromium.googlesource.com/chromium/src.git/+/0ff6cfd2ae2f17dd8f99ae09f04b0fb24fd2a09fhttps://chromium.googlesource.com/chromium/src.git/+/e60c93afaa485a6641ccd26222581626f74a7cac
commit dcdd123f162664500d3976cdcb8e575ad8711bcf
Author: Mikel Astiz <mastiz@chromium.org>
Date: Fri Jan 29 18:43:53 2021 +0000
[sync] Move SyncTransportDataPrefs closer to SyncEngineImpl
These preferences represent the internal bookkeeping data that the
implementation of the sync engine owns (SyncEngineImpl, backend, etc.),
to be persisted in prefs.
This patch moves the resposibility for dealing with prefs (reads and
writes) from ProfileSyncService to SyncEngineImpl, simplifying some of
of the APIs in between and adhering to more strict layering principles.
Instead of moving all functionality in a single patch, the most relevant
parts are moved, but TODOs are added to move the remaining parts and
therefore completely avoid the dependency from ProfileSyncService to
SyncTransportDataPrefs. Meanwhile, *both* ProfileSyncService and
SyncEngineImpl interact with these preferences, which is obviously not
great.
Bug: 938894
commit 0ff6cfd2ae2f17dd8f99ae09f04b0fb24fd2a09f
Author: Mikel Astiz <mastiz@chromium.org>
Date: Fri Jan 29 12:52:21 2021 +0000
[sync] Avoid abuse of mocks in ProfileSyncService tests
In particular the tests in ProfileSyncServiceStartupTest made heavy use
of statefull mocks, well beyond a reasonable use of mocks.
Instead, this patch adopts fakes that mimic the production behavior
without tests having to carefully do so. For DataTypeManager, there is
currently no fake, so instead the actual DataTypeManagerImpl is used,
which is perfectly testable in combination with FakeDataTypeController.
Bug: 938894
commit e60c93afaa485a6641ccd26222581626f74a7cac
Author: Marc Treib <treib@chromium.org>
Date: Tue Jan 26 17:10:16 2021 +0000
Cleanup: Remove initial_types param from DataTypeManagerImpl's ctor
The param was used to initialize the downloaded_types_ member, but that
anyway got recomputed in ActivateDataTypes(), so the initial value had
no effect. This CL removes the param, and all the plumbing that was in
place for it.
Note that there was one test which used the initial_types param, with
the intention of marking these types as "already downloaded". The test
passes before as after this CL. Fixing the test so that it actually
tests what it claims to test is left as a followup.
Bug: 1170318
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/e6f8dd260408c85298a2e22a77064e127db6ffd5
commit e6f8dd260408c85298a2e22a77064e127db6ffd5
Author: Victor Hugo Vianna Silva <victorvianna@google.com>
Date: Wed Dec 16 08:53:49 2020 +0000
[sync] Stop recording obsolete cookie jar histograms
Sync.{CookieJarEmptyOnMismatch,CookieJarMatchOnNavigation} have been
expired since M77. This CL marks them as obsolete and removes the
associated plumbing to record them, which is considerable.
Bug: 1158449
- renamed target to "unit_tests"
- fixed gn_check errors
- moved brave_sync_auth_manager_unittest.cc from test/BUILD.gn into proper target
- had to apply lint to whole test/BUILD.gn
Chromium change:
https://chromium.googlesource.com/chromium/src.git/+/52c253e300831067aa75506906a4af2064edadb2
commit 52c253e300831067aa75506906a4af2064edadb2
Author: danakj <danakj@chromium.org>
Date: Wed Nov 11 21:56:28 2020 +0000
Reland "Remove empty base/bind_helpers.h"
This is a reland of 6f8b5118468b9a64fccf59d7918b88f4c7c5342b
Original change's description:
> Remove empty base/bind_helpers.h
>
> The contents moved to callback_helpers.h.
>
> Also renames a few new bind_helpers.h includes that have been added
> in the meantime.
>
- renamed target to "unit_tests"
- fixed gn_check errors
- moved brave_sync_auth_manager_unittest.cc from test/BUILD.gn into proper target
- had to apply lint to whole test/BUILD.gn
Reason we need space separator:
In `components/sync/driver/about_sync_util.cc`,
`client_version` and `username` both are `Stat<std::string>*` setting a string
directly. And then pass data to js through `onAboutInfoUpdated` event
which will be eventually passed to `jstProcess` and get value through
`chrome.sync.about_tab.highlightIfChanged(this, this.children[1].innerText, stat_value)'>`
The whole process is no different between these two but <td> of
`username` will have tremendously long width if we don't put any space
in the string.
every sync server response. If network time is unavailable, local time
will be used and network time will get updated no matter the access token is
accpeted by server or not. So we no longer need extra access fetcher
to get timestamp from server.
Brave sync now won't set primary account in IdentityManager which
interferes with `chrome.identity` extension API