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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 1836283002: Implement HTMLCanvasElement's transferControlToOffscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unit test Created 4 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
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
index 3ab020a9f880b3752e362ac5e121fd7da50ef3e8..bc53fef463a0b9ff43b7360012e4c5f10fdb0ffd 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -13,8 +13,10 @@
#include "core/imagebitmap/ImageBitmapOptions.h"
#include "core/loader/EmptyClients.h"
#include "core/testing/DummyPageHolder.h"
+#include "modules/canvas/HTMLCanvasElementModule.h"
#include "modules/canvas2d/CanvasGradient.h"
#include "modules/canvas2d/CanvasPattern.h"
+#include "modules/offscreencanvas/OffscreenCanvas.h"
#include "modules/webgl/WebGLRenderingContext.h"
#include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
#include "platform/graphics/RecordingImageBufferSurface.h"
@@ -719,4 +721,12 @@ TEST_F(CanvasRenderingContext2DTest, GPUMemoryUpdateForAcceleratedCanvas)
EXPECT_EQ(0, getGlobalGPUMemoryUsage());
}
+TEST_F(CanvasRenderingContext2DTest, TransferControlToOffscreen)
Justin Novosad 2016/03/30 19:51:06 Good test, but wrong place for it. It has nothing
+{
+ NonThrowableExceptionState exceptionState;
+ OffscreenCanvas* offscreenCanvas = HTMLCanvasElementModule::transferControlToOffscreen(canvasElement(), exceptionState);
+ HTMLCanvasElement* canvas = offscreenCanvas->getAssociatedCanvas();
+ EXPECT_EQ(canvas, canvasElement());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698