summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/user_script_master_unittest.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:37:06 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:37:06 +0000
commitfc368956c37b3f6447103d97d034c8dfa5f2ed5f (patch)
tree26c91201cb807544275af7e8d9423f7875e13bf7 /chrome/browser/extensions/user_script_master_unittest.cc
parent651f749bb3ee9a7d6a9c239f703351a499e16832 (diff)
downloadchromium_src-fc368956c37b3f6447103d97d034c8dfa5f2ed5f.zip
chromium_src-fc368956c37b3f6447103d97d034c8dfa5f2ed5f.tar.gz
chromium_src-fc368956c37b3f6447103d97d034c8dfa5f2ed5f.tar.bz2
Use a NotificationRegistrar to listen for notifications.
BUG=2381 Review URL: http://codereview.chromium.org/113717 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16665 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/user_script_master_unittest.cc')
-rw-r--r--chrome/browser/extensions/user_script_master_unittest.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc
index 0e1b5c4..3b92d24 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -11,6 +11,7 @@
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -36,18 +37,11 @@ class UserScriptMasterTest : public testing::Test,
file_util::CreateDirectory(script_dir_);
// Register for all user script notifications.
- NotificationService::current()->AddObserver(
- this,
- NotificationType::USER_SCRIPTS_LOADED,
- NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::USER_SCRIPTS_LOADED,
+ NotificationService::AllSources());
}
virtual void TearDown() {
- NotificationService::current()->RemoveObserver(
- this,
- NotificationType::USER_SCRIPTS_LOADED,
- NotificationService::AllSources());
-
// Clean up test directory.
ASSERT_TRUE(file_util::Delete(script_dir_, true));
ASSERT_FALSE(file_util::PathExists(script_dir_));
@@ -63,6 +57,8 @@ class UserScriptMasterTest : public testing::Test,
MessageLoop::current()->Quit();
}
+ NotificationRegistrar registrar_;
+
// MessageLoop used in tests.
MessageLoop message_loop_;