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

Issue 876833002: wifi_sync: allow WifiCredentialSyncableServiceFactory to ignore LoginState (Closed)

Created:
5 years, 11 months ago by mukesh agrawal
Modified:
5 years, 10 months ago
CC:
chromium-reviews, tim+watch_chromium.org, pvalenzuela+watch_chromium.org, maxbogue+watch_chromium.org, zea+watch_chromium.org, maniscalco+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@submit-4.3-syncable-service
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

wifi_sync: allow WifiCredentialSyncableServiceFactory to ignore LoginState WifiCredentialSyncableServiceFactory normally uses chromeos::LoginState to associate a SyncableService with a Shill profile. For this to work, LoginState must have been set properly, before someone tries to use the Factory to create a SyncableService. The precondition is met in production mode. However, in sync integration tests, it is difficult to arrange for LoginState to be configured properly. The problem is that the sync integration test framework creates multiple SyncableServices, without providing the test case the ability to change configuration between the construction of the SyncableServices. Acccomodate the way sync integration test work, by allowing the WifiCredentialSyncableServiceFactory to ignore LoginState. When LoginState is ignored, the factory will, instead, use the BrowserContext to associate the new SyncableService with a Shill profile. This works for sync integration tests, because each SyncableService created by the test framework has a separate BrowserContext. BUG=chromium:431435 TEST=components_unittests --gtest_filter="Wifi*" Committed: https://crrev.com/73bbc93c565dac4de1054a0664217989d1761979 Cr-Commit-Position: refs/heads/master@{#314981}

Patch Set 1 #

Total comments: 6

Patch Set 2 : address PS1 feedback from stevenjb #

Patch Set 3 : remove BuildWifiConfigDelegate, restore BuildWifiConfigDelegateChromeOs #

Total comments: 4

Patch Set 4 : address PS3 feedback from stevenjb #

Total comments: 3

Patch Set 5 : move string include to cc file #

Total comments: 3

Patch Set 6 : use directory-level dependency (instead of file-level) #

Total comments: 2

Patch Set 7 : add comments explaining use of BrowserContext::GetPath() #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -23 lines) Patch
M components/wifi_sync/DEPS View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M components/wifi_sync/wifi_credential_syncable_service_factory.h View 1 2 3 4 4 chunks +25 lines, -4 lines 0 comments Download
M components/wifi_sync/wifi_credential_syncable_service_factory.cc View 1 2 3 4 5 6 3 chunks +46 lines, -19 lines 2 comments Download

Messages

Total messages: 29 (7 generated)
mukesh agrawal
This CL is needed by https://codereview.chromium.org/843483004/
5 years, 11 months ago (2015-01-27 02:03:45 UTC) #1
stevenjb
https://codereview.chromium.org/876833002/diff/1/components/wifi_sync/wifi_credential_syncable_service_factory.cc File components/wifi_sync/wifi_credential_syncable_service_factory.cc (right): https://codereview.chromium.org/876833002/diff/1/components/wifi_sync/wifi_credential_syncable_service_factory.cc#newcode38 components/wifi_sync/wifi_credential_syncable_service_factory.cc:38: void WifiCredentialSyncableServiceFactory::IgnoreLoginStateForTest() { Rather than having a method to ...
5 years, 10 months ago (2015-01-28 01:04:58 UTC) #4
mukesh agrawal
oops. i folded the wrong methods together. will revise.
5 years, 10 months ago (2015-01-28 19:39:30 UTC) #5
mukesh agrawal
Thanks, stevenjb. PTAL. https://codereview.chromium.org/876833002/diff/1/components/wifi_sync/wifi_credential_syncable_service_factory.cc File components/wifi_sync/wifi_credential_syncable_service_factory.cc (right): https://codereview.chromium.org/876833002/diff/1/components/wifi_sync/wifi_credential_syncable_service_factory.cc#newcode38 components/wifi_sync/wifi_credential_syncable_service_factory.cc:38: void WifiCredentialSyncableServiceFactory::IgnoreLoginStateForTest() { On 2015/01/28 01:04:58, ...
5 years, 10 months ago (2015-01-28 20:07:24 UTC) #6
stevenjb
OK, that's fine, mostly looks OK with a couple small changes. https://codereview.chromium.org/876833002/diff/40001/components/wifi_sync/wifi_credential_syncable_service_factory.h File components/wifi_sync/wifi_credential_syncable_service_factory.h (right): ...
5 years, 10 months ago (2015-01-28 21:12:20 UTC) #7
mukesh agrawal
Thanks again, stevenjb. PTAL. https://codereview.chromium.org/876833002/diff/40001/components/wifi_sync/wifi_credential_syncable_service_factory.h File components/wifi_sync/wifi_credential_syncable_service_factory.h (right): https://codereview.chromium.org/876833002/diff/40001/components/wifi_sync/wifi_credential_syncable_service_factory.h#newcode64 components/wifi_sync/wifi_credential_syncable_service_factory.h:64: std::string GetUserHash(content::BrowserContext* context) const; On ...
5 years, 10 months ago (2015-01-28 22:26:27 UTC) #8
stevenjb
lgtm https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/wifi_credential_syncable_service_factory.h File components/wifi_sync/wifi_credential_syncable_service_factory.h (right): https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/wifi_credential_syncable_service_factory.h#newcode66 components/wifi_sync/wifi_credential_syncable_service_factory.h:66: bool ignore_login_state_for_test_ = false; nice.
5 years, 10 months ago (2015-01-28 22:47:24 UTC) #9
erikwright (departed)
Where are the syncable services actually instantiated? https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/DEPS File components/wifi_sync/DEPS (right): https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/DEPS#newcode8 components/wifi_sync/DEPS:8: "+content/public/browser/browser_context.h", Don't ...
5 years, 10 months ago (2015-01-29 16:01:35 UTC) #10
mukesh agrawal
On 2015/01/29 16:01:35, erikwright wrote: > Where are the syncable services actually instantiated? In normal ...
5 years, 10 months ago (2015-01-29 18:56:45 UTC) #11
mukesh agrawal
erikwright: Thanks and PTAL. https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/DEPS File components/wifi_sync/DEPS (right): https://codereview.chromium.org/876833002/diff/80001/components/wifi_sync/DEPS#newcode8 components/wifi_sync/DEPS:8: "+content/public/browser/browser_context.h", On 2015/01/29 16:01:35, erikwright ...
5 years, 10 months ago (2015-01-29 18:57:03 UTC) #12
erikwright (departed)
I think it would be better if the dependencies of the code under test could ...
5 years, 10 months ago (2015-01-29 19:02:31 UTC) #13
mukesh agrawal
On 2015/01/29 19:02:31, erikwright wrote: > I think it would be better if the dependencies ...
5 years, 10 months ago (2015-02-04 19:46:48 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/876833002/100001
5 years, 10 months ago (2015-02-04 19:48:15 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/40449)
5 years, 10 months ago (2015-02-04 19:54:43 UTC) #18
mukesh agrawal
creis@, can you review/approve the DEPS change? (I'm adding a dependency from my new component, ...
5 years, 10 months ago (2015-02-04 22:57:32 UTC) #21
Charlie Reis
Happy to rubber stamp, but I don't understand why this needs the BrowserContext's path, or ...
5 years, 10 months ago (2015-02-05 01:07:57 UTC) #22
mukesh agrawal
On 2015/02/05 01:07:57, Charlie Reis wrote: > Happy to rubber stamp, but I don't understand ...
5 years, 10 months ago (2015-02-06 02:40:32 UTC) #23
mukesh agrawal
https://codereview.chromium.org/876833002/diff/100001/components/wifi_sync/wifi_credential_syncable_service_factory.cc File components/wifi_sync/wifi_credential_syncable_service_factory.cc (right): https://codereview.chromium.org/876833002/diff/100001/components/wifi_sync/wifi_credential_syncable_service_factory.cc#newcode37 components/wifi_sync/wifi_credential_syncable_service_factory.cc:37: return context->GetPath().BaseName().value(); On 2015/02/05 01:07:57, Charlie Reis wrote: > ...
5 years, 10 months ago (2015-02-06 02:40:55 UTC) #24
Charlie Reis
Thanks for clarifying. Seems that it's just for tests, so that's fine. DEPS LGTM.
5 years, 10 months ago (2015-02-06 04:47:53 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/876833002/120001
5 years, 10 months ago (2015-02-06 04:54:36 UTC) #27
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 10 months ago (2015-02-06 05:33:09 UTC) #28
commit-bot: I haz the power
5 years, 10 months ago (2015-02-06 05:34:53 UTC) #29
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/73bbc93c565dac4de1054a0664217989d1761979
Cr-Commit-Position: refs/heads/master@{#314981}

Powered by Google App Engine
This is Rietveld 408576698