Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1381)

Unified Diff: remoting/host/differ_unittest.cc

Issue 2832043: Fixes leaks in remote_unittest.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/differ.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/differ_unittest.cc
===================================================================
--- remoting/host/differ_unittest.cc (revision 51089)
+++ remoting/host/differ_unittest.cc (working copy)
@@ -142,8 +142,8 @@
ClearDiffInfo();
MarkBlocks(x_origin, y_origin, width, height);
- DirtyRects* dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ scoped_ptr<DirtyRects> dirty(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(1UL, dirty->size());
CheckDirtyRect(dirty->at(0), x_origin, y_origin, width, height);
@@ -269,8 +269,8 @@
// +---+---+---+---+
ClearDiffInfo();
- DirtyRects* dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ scoped_ptr<DirtyRects> dirty(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
EXPECT_EQ(0UL, dirty->size());
}
@@ -416,7 +416,7 @@
// The exact rects returned depend on the current implementation, so these
// may need to be updated if we modify how we merge blocks.
TEST_F(DifferTest, MergeBlocks_MultiRect) {
- DirtyRects* dirty;
+ scoped_ptr<DirtyRects> dirty;
// +---+---+---+---+ +---+---+---+
// | | X | | _ | | | 0 | |
@@ -432,8 +432,8 @@
MarkBlocks(0, 1, 1, 1);
MarkBlocks(2, 2, 1, 1);
- dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ dirty.reset(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(3UL, dirty->size());
CheckDirtyRect(dirty->at(0), 1, 0, 1, 1);
@@ -453,8 +453,8 @@
MarkBlocks(2, 0, 1, 3);
MarkBlocks(0, 1, 2, 2);
- dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ dirty.reset(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(2UL, dirty->size());
CheckDirtyRect(dirty->at(0), 2, 0, 1, 3);
@@ -474,8 +474,8 @@
MarkBlocks(2, 1, 1, 1);
MarkBlocks(0, 2, 3, 1);
- dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ dirty.reset(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(3UL, dirty->size());
CheckDirtyRect(dirty->at(0), 0, 1, 1, 2);
@@ -497,8 +497,8 @@
MarkBlocks(2, 1, 1, 1);
MarkBlocks(0, 2, 3, 1);
- dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ dirty.reset(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(4UL, dirty->size());
CheckDirtyRect(dirty->at(0), 0, 0, 3, 1);
@@ -519,8 +519,8 @@
MarkBlocks(0, 0, 2, 2);
MarkBlocks(1, 2, 1, 1);
- dirty = new DirtyRects();
- differ_->MergeBlocks(dirty);
+ dirty.reset(new DirtyRects());
+ differ_->MergeBlocks(dirty.get());
ASSERT_EQ(2UL, dirty->size());
CheckDirtyRect(dirty->at(0), 0, 0, 2, 2);
« no previous file with comments | « remoting/host/differ.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698