summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/script_badge_controller_unittest.cc
diff options
context:
space:
mode:
authorbartfab@google.com <bartfab@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 16:36:05 +0000
committerbartfab@google.com <bartfab@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-23 16:36:05 +0000
commitcbe67852f909edc70d3aebcc69e7ccade5b46a36 (patch)
treea88f490e25222a5edc47f0538011e5fcdcae5a07 /chrome/browser/extensions/script_badge_controller_unittest.cc
parentb8bdec2e625e03470f5dccfc6865031dec2a1af6 (diff)
downloadchromium_src-cbe67852f909edc70d3aebcc69e7ccade5b46a36.zip
chromium_src-cbe67852f909edc70d3aebcc69e7ccade5b46a36.tar.gz
chromium_src-cbe67852f909edc70d3aebcc69e7ccade5b46a36.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 Review URL: https://codereview.chromium.org/14192040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195811 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.cc8
1 files changed, 8 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..1e7f506 100644
--- a/chrome/browser/extensions/script_badge_controller_unittest.cc
+++ b/chrome/browser/extensions/script_badge_controller_unittest.cc
@@ -31,6 +31,10 @@
#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"
+#endif
+
using content::BrowserThread;
namespace extensions {
@@ -95,6 +99,10 @@ class ScriptBadgeControllerTest : public ChromeRenderViewHostTestHarness {
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
Feature::ScopedCurrentChannel current_channel_;
+
+#if defined OS_CHROMEOS
+ chromeos::ScopedTestUserManager test_user_manager_;
+#endif
};
struct CountingNotificationObserver : public content::NotificationObserver {