| 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 7ddd64cf5edb467a857fe0e34e754c74b403d170..d06f1c3f8661a668ed87efde11e3478a773ad2c2 100644
|
| --- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| +++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModuleTest.cpp
|
| @@ -29,14 +29,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())));
|
| }
|
|
|