| Index: third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| index 9ed184d0bb3ec839898b5e7660d448501d846ce7..9980e89f5a88e7a6aebc0bb7d930c51cbd75b5b4 100644
|
| --- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| @@ -30,14 +30,23 @@ protected:
|
| }
|
|
|
| HTMLCanvasElement& canvasElement() const { return *m_canvasElement; }
|
| + OffscreenCanvas* transferControlToOffscreen(ExceptionState&);
|
| +
|
| private:
|
| Persistent<HTMLCanvasElement> m_canvasElement;
|
| };
|
|
|
| +OffscreenCanvas* HTMLCanvasElementModuleTest::transferControlToOffscreen(ExceptionState& exceptionState)
|
| +{
|
| + // This unit test only tests if the Canvas Id is associated correctly, so we exclude the part that
|
| + // creates surface layer bridge because a mojo message pipe cannot be tested using webkit unit tests.
|
| + return HTMLCanvasElementModule::transferControlToOffscreenInternal(canvasElement(), exceptionState);
|
| +}
|
| +
|
| TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen)
|
| {
|
| NonThrowableExceptionState exceptionState;
|
| - OffscreenCanvas* offscreenCanvas = HTMLCanvasElementModule::transferControlToOffscreen(canvasElement(), exceptionState);
|
| + OffscreenCanvas* offscreenCanvas = transferControlToOffscreen(exceptionState);
|
| int canvasId = offscreenCanvas->getAssociatedCanvasId();
|
| EXPECT_EQ(canvasId, DOMNodeIds::idForNode(&(canvasElement())));
|
| }
|
|
|