diff options
author | bartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 00:11:51 +0000 |
---|---|---|
committer | bartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 00:11:51 +0000 |
commit | e4854dc542c049d2bcbf4587be05a5d5cc4acf25 (patch) | |
tree | 5daf22a82ee40ed51f75a028248930ed01f6f5aa /chrome/browser/extensions/script_badge_controller_unittest.cc | |
parent | f3b3ba7bc2f675606d5def3a0982b3988e529b13 (diff) | |
download | chromium_src-e4854dc542c049d2bcbf4587be05a5d5cc4acf25.zip chromium_src-e4854dc542c049d2bcbf4587be05a5d5cc4acf25.tar.gz chromium_src-e4854dc542c049d2bcbf4587be05a5d5cc4acf25.tar.bz2 |
Explicitly construct/destruct UserManager and dependencies in tests
The ScopedTestUserManager initializes and subsequently tears down the
UserManager singleton only if it has not been initialized already. This
allows ScopedTestUserManagers to be nested but also means that it is
never clear which ScopedTestUserManager actually did end up initializing
the singleton. The same goes for ScopedTestCrosSettings.
This CL makes the initialization and teardown explicit. The helper classes
now explicitly manage the initialization and teardown of their respective
singletons and cannot be nested anymore.
BUG=None
For tests that need to instantiate a UserManager:
TBR=sky,rkc,aa,thestig,asvitkine,davemoore,kinuko,pkotwicz,davemoore,akalin
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195811
Review URL: https://chromiumcodereview.appspot.com/14192040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/script_badge_controller_unittest.cc')
-rw-r--r-- | chrome/browser/extensions/script_badge_controller_unittest.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc index cb773f8..9600018 100644 --- a/chrome/browser/extensions/script_badge_controller_unittest.cc +++ b/chrome/browser/extensions/script_badge_controller_unittest.cc @@ -31,6 +31,12 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/login/user_manager.h" +#include "chrome/browser/chromeos/settings/cros_settings.h" +#include "chrome/browser/chromeos/settings/device_settings_service.h" +#endif + using content::BrowserThread; namespace extensions { @@ -95,6 +101,12 @@ class ScriptBadgeControllerTest : public ChromeRenderViewHostTestHarness { content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; Feature::ScopedCurrentChannel current_channel_; + +#if defined OS_CHROMEOS + chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; + chromeos::ScopedTestCrosSettings test_cros_settings_; + chromeos::ScopedTestUserManager test_user_manager_; +#endif }; struct CountingNotificationObserver : public content::NotificationObserver { |