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

Side by Side Diff: Source/core/frame/ImageBitmapTest.cpp

Issue 209433004: Do not zero-initialize RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compilation on gcc and msvc Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 ASSERT_NE(imageBitmap->bitmapImage()->nativeImageForCurrentFrame()->bitmap() .pixelRef()->pixels(), 203 ASSERT_NE(imageBitmap->bitmapImage()->nativeImageForCurrentFrame()->bitmap() .pixelRef()->pixels(),
204 newImageResource->image()->nativeImageForCurrentFrame()->bitmap().pixelR ef()->pixels()); 204 newImageResource->image()->nativeImageForCurrentFrame()->bitmap().pixelR ef()->pixels());
205 } 205 }
206 206
207 // Verifies that ImageBitmaps constructed from ImageBitmaps hold onto their own Image. 207 // Verifies that ImageBitmaps constructed from ImageBitmaps hold onto their own Image.
208 TEST_F(ImageBitmapTest, ImageResourceLifetime) 208 TEST_F(ImageBitmapTest, ImageResourceLifetime)
209 { 209 {
210 RefPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::create(*Documen t::create().get()); 210 RefPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::create(*Documen t::create().get());
211 canvasElement->setHeight(40); 211 canvasElement->setHeight(40);
212 canvasElement->setWidth(40); 212 canvasElement->setWidth(40);
213 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived; 213 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived = nullptr;
214 { 214 {
215 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::cre ate(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->he ight())); 215 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::cre ate(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->he ight()));
216 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In tRect(0, 0, 20, 20)); 216 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In tRect(0, 0, 20, 20));
217 } 217 }
218 CanvasRenderingContext* context = canvasElement->getContext("2d"); 218 CanvasRenderingContext* context = canvasElement->getContext("2d");
219 TrackExceptionState exceptionState; 219 TrackExceptionState exceptionState;
220 toCanvasRenderingContext2D(context)->drawImage(imageBitmapDerived.get(), 0, 0, exceptionState); 220 toCanvasRenderingContext2D(context)->drawImage(imageBitmapDerived.get(), 0, 0, exceptionState);
221 } 221 }
222 222
223 } // namespace 223 } // namespace
OLDNEW
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698