summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/greasemonkey_master.cc3
-rw-r--r--chrome/browser/greasemonkey_master_unittest.cc8
2 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/greasemonkey_master.cc b/chrome/browser/greasemonkey_master.cc
index 2648fa0..288b379 100644
--- a/chrome/browser/greasemonkey_master.cc
+++ b/chrome/browser/greasemonkey_master.cc
@@ -164,7 +164,8 @@ GreasemonkeyMaster::GreasemonkeyMaster(MessageLoop* worker_loop,
const FilePath& script_dir)
: user_script_dir_(new FilePath(script_dir)),
dir_watcher_(new DirectoryWatcher),
- worker_loop_(worker_loop) {
+ worker_loop_(worker_loop),
+ pending_scan_(false) {
// Watch our scripts directory for modifications.
bool ok = dir_watcher_->Watch(script_dir, this);
DCHECK(ok);
diff --git a/chrome/browser/greasemonkey_master_unittest.cc b/chrome/browser/greasemonkey_master_unittest.cc
index b3ce12f..0987a6b 100644
--- a/chrome/browser/greasemonkey_master_unittest.cc
+++ b/chrome/browser/greasemonkey_master_unittest.cc
@@ -53,7 +53,7 @@ class GreasemonkeyMasterTest : public testing::Test,
const NotificationDetails& details) {
DCHECK(type == NOTIFY_NEW_USER_SCRIPTS);
- shared_memory_ = Details<SharedMemory>(details).ptr();
+ shared_memory_.reset(Details<SharedMemory>(details).ptr());
if (MessageLoop::current() == &message_loop_)
MessageLoop::current()->Quit();
}
@@ -65,13 +65,13 @@ class GreasemonkeyMasterTest : public testing::Test,
FilePath script_dir_;
// Updated to the script shared memory when we get notified.
- SharedMemory* shared_memory_;
+ scoped_ptr<SharedMemory> shared_memory_;
};
// Test that we *don't* get spurious notifications.
TEST_F(GreasemonkeyMasterTest, NoScripts) {
// Set shared_memory_ to something non-NULL, so we can check it became NULL.
- shared_memory_ = reinterpret_cast<SharedMemory*>(1);
+ shared_memory_.reset(reinterpret_cast<SharedMemory*>(1));
scoped_refptr<GreasemonkeyMaster> master(
new GreasemonkeyMaster(MessageLoop::current(), script_dir_));
@@ -80,7 +80,7 @@ TEST_F(GreasemonkeyMasterTest, NoScripts) {
// There were no scripts in the script dir, so we shouldn't have gotten
// a notification.
- ASSERT_EQ(NULL, shared_memory_);
+ ASSERT_EQ(NULL, shared_memory_.get());
}
// Test that we get notified about new scripts after they're added.