diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 21:51:08 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 21:51:08 +0000 |
commit | 2a1752a2bc01b7fc391c5a11ee37f63f78832d67 (patch) | |
tree | fef122ccdb0ec6096c90cb6ea7833d0a51188203 /chrome/browser/greasemonkey_master_unittest.cc | |
parent | cc47c017983b27b25ead33b0da2805ab654c73b3 (diff) | |
download | chromium_src-2a1752a2bc01b7fc391c5a11ee37f63f78832d67.zip chromium_src-2a1752a2bc01b7fc391c5a11ee37f63f78832d67.tar.gz chromium_src-2a1752a2bc01b7fc391c5a11ee37f63f78832d67.tar.bz2 |
The SharedMemory is owned by the GreasemonkeyMaster, not the unit test. My previous attempt at fixing the purify problem was overzealous; I just needed to fix the uninitialized boolean that my previous "fix" did. This change halfway-reverts to before that state.
Review URL: http://codereview.chromium.org/8893
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/greasemonkey_master_unittest.cc')
-rw-r--r-- | chrome/browser/greasemonkey_master_unittest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/greasemonkey_master_unittest.cc b/chrome/browser/greasemonkey_master_unittest.cc index 0987a6b..71676d7 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_.reset(Details<SharedMemory>(details).ptr()); + shared_memory_ = 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. - scoped_ptr<SharedMemory> shared_memory_; + 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_.reset(reinterpret_cast<SharedMemory*>(1)); + shared_memory_ = 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_.get()); + ASSERT_EQ(NULL, shared_memory_); } // Test that we get notified about new scripts after they're added. @@ -115,4 +115,4 @@ TEST_F(GreasemonkeyMasterTest, ExistingScripts) { message_loop_.Run(); ASSERT_TRUE(shared_memory_ != NULL); -}
\ No newline at end of file +} |