OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/canvas/HTMLCanvasElementModule.h" | 5 #include "modules/canvas/HTMLCanvasElementModule.h" |
6 | 6 |
7 #include "core/dom/DOMNodeIds.h" | |
8 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
9 #include "core/html/HTMLCanvasElement.h" | 8 #include "core/html/HTMLCanvasElement.h" |
10 #include "core/html/HTMLDocument.h" | 9 #include "core/html/HTMLDocument.h" |
11 #include "core/loader/EmptyClients.h" | 10 #include "core/loader/EmptyClients.h" |
12 #include "core/testing/DummyPageHolder.h" | 11 #include "core/testing/DummyPageHolder.h" |
13 #include "modules/offscreencanvas/OffscreenCanvas.h" | 12 #include "modules/offscreencanvas/OffscreenCanvas.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
15 | 14 |
16 namespace blink { | 15 namespace blink { |
17 | 16 |
(...skipping 12 matching lines...) Expand all Loading... |
30 | 29 |
31 HTMLCanvasElement& canvasElement() const { return *m_canvasElement; } | 30 HTMLCanvasElement& canvasElement() const { return *m_canvasElement; } |
32 private: | 31 private: |
33 Persistent<HTMLCanvasElement> m_canvasElement; | 32 Persistent<HTMLCanvasElement> m_canvasElement; |
34 }; | 33 }; |
35 | 34 |
36 TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen) | 35 TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen) |
37 { | 36 { |
38 NonThrowableExceptionState exceptionState; | 37 NonThrowableExceptionState exceptionState; |
39 OffscreenCanvas* offscreenCanvas = HTMLCanvasElementModule::transferControlT
oOffscreen(canvasElement(), exceptionState); | 38 OffscreenCanvas* offscreenCanvas = HTMLCanvasElementModule::transferControlT
oOffscreen(canvasElement(), exceptionState); |
40 int canvasId = offscreenCanvas->getAssociatedCanvasId(); | 39 HTMLCanvasElement* canvas = offscreenCanvas->getAssociatedCanvas(); |
41 EXPECT_EQ(canvasId, DOMNodeIds::idForNode(&(canvasElement()))); | 40 EXPECT_EQ(canvas, canvasElement()); |
42 } | 41 } |
43 | 42 |
44 } // namespace blink | 43 } // namespace blink |
OLD | NEW |