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

Unified Diff: ui/gfx/image/image_mac_unittest.mm

Issue 10533107: Fixes memory leak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « tools/valgrind/memcheck/suppressions_mac.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_mac_unittest.mm
diff --git a/ui/gfx/image/image_mac_unittest.mm b/ui/gfx/image/image_mac_unittest.mm
index 924cebd048f23d48100fb35665381d117140b76c..e49217fa9ca671d32c2ac1f38db41dc854810ee2 100644
--- a/ui/gfx/image/image_mac_unittest.mm
+++ b/ui/gfx/image/image_mac_unittest.mm
@@ -16,9 +16,9 @@ namespace {
class ImageMacTest : public testing::Test {
public:
- void CreateBitmapImageRep(int width, int height,
- NSBitmapImageRep** image_rep) {
- *image_rep = [[NSBitmapImageRep alloc]
+ void BitmapImageRep(int width, int height,
+ NSBitmapImageRep** image_rep) {
+ *image_rep = [[[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:NULL
pixelsWide:width
pixelsHigh:height
@@ -29,7 +29,8 @@ class ImageMacTest : public testing::Test {
colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:0
bytesPerRow:0
- bitsPerPixel:0];
+ bitsPerPixel:0]
+ autorelease];
}
};
@@ -42,7 +43,7 @@ TEST_F(ImageMacTest, NSImageWithResizedNSImageRepToImageSkia) {
const int kHeight2x = 24;
NSBitmapImageRep* image_rep;
- CreateBitmapImageRep(kWidth2x, kHeight2x, &image_rep);
+ BitmapImageRep(kWidth2x, kHeight2x, &image_rep);
scoped_nsobject<NSImage> ns_image(
[[NSImage alloc] initWithSize:NSMakeSize(kWidth1x, kHeight1x)]);
@@ -68,9 +69,9 @@ TEST_F(ImageMacTest, MultiResolutionNSImageToImageSkia) {
const int kHeight2x = 24;
NSBitmapImageRep* image_rep_1;
- CreateBitmapImageRep(kWidth1x, kHeight1x, &image_rep_1);
+ BitmapImageRep(kWidth1x, kHeight1x, &image_rep_1);
NSBitmapImageRep* image_rep_2;
- CreateBitmapImageRep(kWidth2x, kHeight2x, &image_rep_2);
+ BitmapImageRep(kWidth2x, kHeight2x, &image_rep_2);
scoped_nsobject<NSImage> ns_image(
[[NSImage alloc] initWithSize:NSMakeSize(kWidth1x, kHeight1x)]);
[ns_image addRepresentation:image_rep_1];
« no previous file with comments | « tools/valgrind/memcheck/suppressions_mac.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698