summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 21:23:37 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 21:23:37 +0000
commit1d111283760e8930b48223a3fd2edc8335cbab9b (patch)
tree98fd2807c08fae86084a5b9518e586f34044416d /chrome/browser/extensions
parentec775ef9b36dbcb5ebbd4fa550443bfa94c53a9f (diff)
downloadchromium_src-1d111283760e8930b48223a3fd2edc8335cbab9b.zip
chromium_src-1d111283760e8930b48223a3fd2edc8335cbab9b.tar.gz
chromium_src-1d111283760e8930b48223a3fd2edc8335cbab9b.tar.bz2
Enable user_script_master_unittest for Mac since DirectoryWatcher was ported.
[See http://crbug.com/10967 ] Review URL: http://codereview.chromium.org/99280 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/user_script_master.cc8
-rw-r--r--chrome/browser/extensions/user_script_master_unittest.cc10
2 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc
index 723b1f3..85d3a6a 100644
--- a/chrome/browser/extensions/user_script_master.cc
+++ b/chrome/browser/extensions/user_script_master.cc
@@ -261,15 +261,15 @@ UserScriptMaster::~UserScriptMaster() {
if (script_reloader_)
script_reloader_->DisownMaster();
-// TODO(aa): Enable this when DirectoryWatcher is implemented for linux and mac.
-#if defined(OS_WIN)
+// TODO(aa): Enable this when DirectoryWatcher is implemented for linux.
+#if defined(OS_WIN) || defined(OS_MACOSX)
STLDeleteElements(&dir_watchers_);
#endif
}
void UserScriptMaster::AddWatchedPath(const FilePath& path) {
-// TODO(aa): Enable this when DirectoryWatcher is implemented for linux and mac.
-#if defined(OS_WIN)
+// TODO(aa): Enable this when DirectoryWatcher is implemented for linux.
+#if defined(OS_WIN) || defined(OS_MACOSX)
DirectoryWatcher* watcher = new DirectoryWatcher();
watcher->Watch(path, this, true);
dir_watchers_.push_back(watcher);
diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc
index 8413847..0e1b5c4 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -20,7 +20,10 @@
class UserScriptMasterTest : public testing::Test,
public NotificationObserver {
public:
- UserScriptMasterTest() : shared_memory_(NULL) {}
+ UserScriptMasterTest()
+ : message_loop_(MessageLoop::TYPE_UI),
+ shared_memory_(NULL) {
+ }
virtual void SetUp() {
// Name a subdirectory of the temp directory.
@@ -86,9 +89,8 @@ TEST_F(UserScriptMasterTest, NoScripts) {
ASSERT_EQ(NULL, shared_memory_);
}
-// TODO(shess): Disabled on Mac and Linux because of missing
-// DirectoryWatcher.
-#if defined(OS_WIN)
+// TODO(shess): Disabled on Linux because of missing DirectoryWatcher.
+#if defined(OS_WIN) || defined(OS_MACOSX)
// Test that we get notified about new scripts after they're added.
TEST_F(UserScriptMasterTest, NewScripts) {
scoped_refptr<UserScriptMaster> master(