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

Unified Diff: sky/engine/core/frame/ImageBitmapTest.cpp

Issue 1001913003: Remove <canvas> (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/frame/ImageBitmap.cpp ('k') | sky/engine/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/frame/ImageBitmapTest.cpp
diff --git a/sky/engine/core/frame/ImageBitmapTest.cpp b/sky/engine/core/frame/ImageBitmapTest.cpp
index 3bfbf9634aa7acd9083c290572c57a9853c47ef5..71d11d347686a74e3f95b59932fbca4b3270fd37 100644
--- a/sky/engine/core/frame/ImageBitmapTest.cpp
+++ b/sky/engine/core/frame/ImageBitmapTest.cpp
@@ -36,9 +36,7 @@
#include "sky/engine/core/fetch/MemoryCache.h"
#include "sky/engine/core/fetch/MockImageResourceClient.h"
#include "sky/engine/core/fetch/ResourcePtr.h"
-#include "sky/engine/core/html/HTMLCanvasElement.h"
#include "sky/engine/core/html/HTMLImageElement.h"
-#include "sky/engine/core/html/canvas/CanvasRenderingContext2D.h"
#include "sky/engine/platform/graphics/BitmapImage.h"
#include "sky/engine/platform/graphics/skia/NativeImageSkia.h"
#include "sky/engine/platform/heap/Handle.h"
@@ -186,20 +184,4 @@ TEST_F(ImageBitmapTest, ImageBitmapSourceChanged)
newImageResource->image()->nativeImageForCurrentFrame()->bitmap().pixelRef()->pixels());
}
-// Verifies that ImageBitmaps constructed from ImageBitmaps hold onto their own Image.
-TEST_F(ImageBitmapTest, ImageResourceLifetime)
-{
- RefPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::create(*Document::create().get());
- canvasElement->setHeight(40);
- canvasElement->setWidth(40);
- RefPtr<ImageBitmap> imageBitmapDerived = nullptr;
- {
- RefPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->height()));
- imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), IntRect(0, 0, 20, 20));
- }
- CanvasRenderingContext* context = canvasElement->getContext("2d");
- TrackExceptionState exceptionState;
- toCanvasRenderingContext2D(context)->drawImage(imageBitmapDerived.get(), 0, 0, exceptionState);
-}
-
} // namespace
« no previous file with comments | « sky/engine/core/frame/ImageBitmap.cpp ('k') | sky/engine/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698