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

Issue 8899002: [cros] Add --stub-cros-settings option for testing. (Closed)

Created:
9 years ago by Ivan Korotkov
Modified:
9 years ago
CC:
chromium-reviews, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

[cros] Add --stub-cros-settings option for testing. With this option, the current user is always treated as owner and all signed settings are stored in memory without signing. All CrosSettingProviders now use a callback to notify CrosSettings observers. BUG=None TEST=StubCrosSettingsProviderTest.*; manual: see CL description Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=114214

Patch Set 1 #

Total comments: 6

Patch Set 2 : CrosSettingsProvider instances use a callback for notifying observers. #

Total comments: 4

Patch Set 3 : Review fixes. #

Patch Set 4 : Merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -23 lines) Patch
M chrome/browser/chromeos/cros_settings.h View 1 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/cros_settings.cc View 1 2 4 chunks +19 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/cros_settings_provider.h View 1 2 2 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/chromeos/cros_settings_provider.cc View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/device_settings_provider.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/device_settings_provider.cc View 1 2 3 4 chunks +7 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/login/ownership_service.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/ownership_service.cc View 5 chunks +9 lines, -1 line 0 comments Download
A chrome/browser/chromeos/stub_cros_settings_provider.h View 1 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/stub_cros_settings_provider.cc View 1 1 chunk +76 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/stub_cros_settings_provider_unittest.cc View 1 2 1 chunk +98 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/system_settings_provider.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/chromeos/system_settings_provider.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Ivan Korotkov
PTAL pastarmovj: *CrosSettings nkostylev: OwnershipService/UserManager
9 years ago (2011-12-09 17:32:47 UTC) #1
Nikita (slow)
lgtm http://codereview.chromium.org/8899002/diff/1/chrome/browser/chromeos/cros_settings.cc File chrome/browser/chromeos/cros_settings.cc (right): http://codereview.chromium.org/8899002/diff/1/chrome/browser/chromeos/cros_settings.cc#newcode270 chrome/browser/chromeos/cros_settings.cc:270: switches::kStubCrosSettings)) nit: Multiline condition requires { } block. ...
9 years ago (2011-12-12 11:04:57 UTC) #2
Ivan Korotkov
Unit-tests added, with necessary changes to CrosSettingsProviders to make FireObservers mocking possible. http://codereview.chromium.org/8899002/diff/1/chrome/browser/chromeos/cros_settings.cc File chrome/browser/chromeos/cros_settings.cc ...
9 years ago (2011-12-13 13:15:09 UTC) #3
pastarmovj
LGTM the change to CrosSettingsProvider and children with two nits. I have a generic question ...
9 years ago (2011-12-13 13:41:06 UTC) #4
Ivan Korotkov
9 years ago (2011-12-13 14:46:16 UTC) #5
I think this is OK since Chrome is not supposed to be started with arbitrary
flags (i.e. user cannot change them) on an official image, and on developer
images the user has any control he wants anyways.

http://codereview.chromium.org/8899002/diff/7001/chrome/browser/chromeos/cros...
File chrome/browser/chromeos/cros_settings.cc (right):

http://codereview.chromium.org/8899002/diff/7001/chrome/browser/chromeos/cros...
chrome/browser/chromeos/cros_settings.cc:277: AddSettingsProvider(new
SystemSettingsProvider(notify_cb));
On 2011/12/13 13:41:07, pastarmovj wrote:
> You might even want to put the real providers in an else clause to avoid
having
> to reload them which might not work well in test environment without proper
> mocking.

Done for Device provider (System provider is not mocked for now anyway).

http://codereview.chromium.org/8899002/diff/7001/chrome/browser/chromeos/stub...
File chrome/browser/chromeos/stub_cros_settings_provider_unittest.cc (right):

http://codereview.chromium.org/8899002/diff/7001/chrome/browser/chromeos/stub...
chrome/browser/chromeos/stub_cros_settings_provider_unittest.cc:82: 
On 2011/12/13 13:41:07, pastarmovj wrote:
> Maybe one more test for Get would be good where you check Get both existing
and
> non existing keys.

Done.

Powered by Google App Engine
This is Rietveld 408576698