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 <memory> |
7 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
8 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
9 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
10 #include "core/html/HTMLCanvasElement.h" | 11 #include "core/html/HTMLCanvasElement.h" |
11 #include "core/loader/EmptyClients.h" | 12 #include "core/loader/EmptyClients.h" |
12 #include "core/offscreencanvas/OffscreenCanvas.h" | 13 #include "core/offscreencanvas/OffscreenCanvas.h" |
13 #include "core/testing/DummyPageHolder.h" | 14 #include "core/testing/DummyPageHolder.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include <memory> | |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class HTMLCanvasElementModuleTest : public ::testing::Test { | 19 class HTMLCanvasElementModuleTest : public ::testing::Test { |
20 protected: | 20 protected: |
21 virtual void SetUp() { | 21 virtual void SetUp() { |
22 Page::PageClients pageClients; | 22 Page::PageClients pageClients; |
23 fillWithEmptyClients(pageClients); | 23 fillWithEmptyClients(pageClients); |
24 std::unique_ptr<DummyPageHolder> m_dummyPageHolder = | 24 std::unique_ptr<DummyPageHolder> m_dummyPageHolder = |
25 DummyPageHolder::create(IntSize(800, 600), &pageClients); | 25 DummyPageHolder::create(IntSize(800, 600), &pageClients); |
(...skipping 21 matching lines...) Expand all Loading... |
47 } | 47 } |
48 | 48 |
49 TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen) { | 49 TEST_F(HTMLCanvasElementModuleTest, TransferControlToOffscreen) { |
50 NonThrowableExceptionState exceptionState; | 50 NonThrowableExceptionState exceptionState; |
51 OffscreenCanvas* offscreenCanvas = transferControlToOffscreen(exceptionState); | 51 OffscreenCanvas* offscreenCanvas = transferControlToOffscreen(exceptionState); |
52 int canvasId = offscreenCanvas->placeholderCanvasId(); | 52 int canvasId = offscreenCanvas->placeholderCanvasId(); |
53 EXPECT_EQ(canvasId, DOMNodeIds::idForNode(&(canvasElement()))); | 53 EXPECT_EQ(canvasId, DOMNodeIds::idForNode(&(canvasElement()))); |
54 } | 54 } |
55 | 55 |
56 } // namespace blink | 56 } // namespace blink |
OLD | NEW |