summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-08 22:35:30 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-08 22:35:30 +0000
commita19124714ececf0de3c5b7b69b013fbbdec9a1b3 (patch)
tree7ef8217c0a96d0cbc823e5727616d37cda58f9c7 /chrome/browser
parente04c7eacaa5092fa740c5ac330f4b8f01755fc2d (diff)
downloadchromium_src-a19124714ececf0de3c5b7b69b013fbbdec9a1b3.zip
chromium_src-a19124714ececf0de3c5b7b69b013fbbdec9a1b3.tar.gz
chromium_src-a19124714ececf0de3c5b7b69b013fbbdec9a1b3.tar.bz2
Fix heapcheck leaks introduced by 58859.
TEST=heapcheck bot goes green TBR=raz@chromium.org Review URL: http://codereview.chromium.org/3361011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/sync/engine/clear_data_command_unittest.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/sync/engine/clear_data_command_unittest.cc b/chrome/browser/sync/engine/clear_data_command_unittest.cc
index cd05e12..8a42108 100644
--- a/chrome/browser/sync/engine/clear_data_command_unittest.cc
+++ b/chrome/browser/sync/engine/clear_data_command_unittest.cc
@@ -66,10 +66,11 @@ TEST_F(ClearDataCommandTest, ClearDataCommandExpectFailed) {
ASSERT_TRUE(dir.good());
ConfigureMockServerConnection();
- SyncerEventChannel* channel = new SyncerEventChannel();
- ClearEventHandler* handler = new ClearEventHandler();
- channel->AddObserver(handler);
- ScopedSessionContextSyncerEventChannel s_channel(context(), channel);
+ scoped_ptr<SyncerEventChannel> channel(new SyncerEventChannel());
+ scoped_ptr<ClearEventHandler> handler(new ClearEventHandler());
+ scoped_ptr<browser_sync::ChannelHookup<SyncerEvent> > hookup(
+ channel.get()->AddObserver(handler.get()));
+ ScopedSessionContextSyncerEventChannel s_channel(context(), channel.get());
dir->set_store_birthday(mock_server()->store_birthday());
mock_server()->SetClearUserDataResponseStatus(sync_pb::RETRIABLE_ERROR);
@@ -93,9 +94,9 @@ TEST_F(ClearDataCommandTest, ClearDataCommandExpectFailed) {
const sync_pb::ClientToServerMessage& r = mock_server()->last_request();
EXPECT_TRUE(r.has_clear_user_data());
- EXPECT_TRUE(handler->ReceievedClearFailedEvent());
+ EXPECT_TRUE(handler.get()->ReceievedClearFailedEvent());
- EXPECT_FALSE(handler->ReceievedClearSuccessEvent());
+ EXPECT_FALSE(handler.get()->ReceievedClearSuccessEvent());
EXPECT_FALSE(on_should_stop_syncing_permanently_called_);
}
@@ -104,10 +105,11 @@ TEST_F(ClearDataCommandTest, ClearDataCommandExpectSucess) {
ASSERT_TRUE(dir.good());
ConfigureMockServerConnection();
- SyncerEventChannel* channel = new SyncerEventChannel();
- ClearEventHandler* handler = new ClearEventHandler();
- channel->AddObserver(handler);
- ScopedSessionContextSyncerEventChannel s_channel(context(), channel);
+ scoped_ptr<SyncerEventChannel> channel(new SyncerEventChannel());
+ scoped_ptr<ClearEventHandler> handler(new ClearEventHandler());
+ scoped_ptr<browser_sync::ChannelHookup<SyncerEvent> > hookup(
+ channel.get()->AddObserver(handler.get()));
+ ScopedSessionContextSyncerEventChannel s_channel(context(), channel.get());
dir->set_store_birthday(mock_server()->store_birthday());
mock_server()->SetClearUserDataResponseStatus(sync_pb::SUCCESS);
@@ -120,7 +122,7 @@ TEST_F(ClearDataCommandTest, ClearDataCommandExpectSucess) {
const sync_pb::ClientToServerMessage& r = mock_server()->last_request();
EXPECT_TRUE(r.has_clear_user_data());
- EXPECT_TRUE(handler->ReceievedClearSuccessEvent());
+ EXPECT_TRUE(handler.get()->ReceievedClearSuccessEvent());
EXPECT_TRUE(on_should_stop_syncing_permanently_called_);
EXPECT_FALSE(handler->ReceievedClearFailedEvent());