OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/frame/FrameView.h" | 5 #include "core/frame/FrameView.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
9 #include "core/html/HTMLElement.h" | 9 #include "core/html/HTMLElement.h" |
10 #include "core/layout/LayoutObject.h" | 10 #include "core/layout/LayoutObject.h" |
11 #include "core/loader/EmptyClients.h" | 11 #include "core/loader/EmptyClients.h" |
12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
13 #include "core/testing/DummyPageHolder.h" | 13 #include "core/testing/DummyPageHolder.h" |
14 #include "platform/RuntimeEnabledFeatures.h" | 14 #include "platform/RuntimeEnabledFeatures.h" |
15 #include "platform/geometry/IntSize.h" | 15 #include "platform/geometry/IntSize.h" |
16 #include "platform/graphics/paint/PaintArtifact.h" | 16 #include "platform/graphics/paint/PaintArtifact.h" |
17 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include <memory> | 20 #include "wtf/OwnPtr.h" |
21 | 21 |
22 using testing::_; | 22 using testing::_; |
23 using testing::AnyNumber; | 23 using testing::AnyNumber; |
24 | 24 |
25 namespace blink { | 25 namespace blink { |
26 namespace { | 26 namespace { |
27 | 27 |
28 class MockChromeClient : public EmptyChromeClient { | 28 class MockChromeClient : public EmptyChromeClient { |
29 public: | 29 public: |
30 MockChromeClient() : m_hasScheduledAnimation(false) { } | 30 MockChromeClient() : m_hasScheduledAnimation(false) { } |
(...skipping 25 matching lines...) Expand all Loading... |
56 clients.chromeClient = m_chromeClient.get(); | 56 clients.chromeClient = m_chromeClient.get(); |
57 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &clients); | 57 m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &clients); |
58 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true); | 58 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true); |
59 } | 59 } |
60 | 60 |
61 Document& document() { return m_pageHolder->document(); } | 61 Document& document() { return m_pageHolder->document(); } |
62 MockChromeClient& chromeClient() { return *m_chromeClient; } | 62 MockChromeClient& chromeClient() { return *m_chromeClient; } |
63 | 63 |
64 private: | 64 private: |
65 Persistent<MockChromeClient> m_chromeClient; | 65 Persistent<MockChromeClient> m_chromeClient; |
66 std::unique_ptr<DummyPageHolder> m_pageHolder; | 66 OwnPtr<DummyPageHolder> m_pageHolder; |
67 }; | 67 }; |
68 | 68 |
69 class FrameViewTest : public FrameViewTestBase { | 69 class FrameViewTest : public FrameViewTestBase { |
70 protected: | 70 protected: |
71 FrameViewTest() | 71 FrameViewTest() |
72 { | 72 { |
73 EXPECT_CALL(chromeClient(), attachRootGraphicsLayer(_, _)).Times(AnyNumb
er()); | 73 EXPECT_CALL(chromeClient(), attachRootGraphicsLayer(_, _)).Times(AnyNumb
er()); |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 { | 150 { |
151 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d
iv>", ASSERT_NO_EXCEPTION); | 151 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d
iv>", ASSERT_NO_EXCEPTION); |
152 document().view()->updateAllLifecyclePhases(); | 152 document().view()->updateAllLifecyclePhases(); |
153 | 153 |
154 EXPECT_CALL(chromeClient(), setToolTip(String(), _)); | 154 EXPECT_CALL(chromeClient(), setToolTip(String(), _)); |
155 document().view()->setScrollPosition(DoublePoint(1, 1), UserScroll); | 155 document().view()->setScrollPosition(DoublePoint(1, 1), UserScroll); |
156 } | 156 } |
157 | 157 |
158 } // namespace | 158 } // namespace |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |