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/graphics/test/FakeGraphicsLayerFactory.h" | |
18 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "wtf/OwnPtr.h" | 20 #include "wtf/OwnPtr.h" |
22 | 21 |
23 using testing::_; | 22 using testing::_; |
24 using testing::AnyNumber; | 23 using testing::AnyNumber; |
25 | 24 |
26 namespace blink { | 25 namespace blink { |
27 namespace { | 26 namespace { |
28 | 27 |
29 class MockChromeClient : public EmptyChromeClient { | 28 class MockChromeClient : public EmptyChromeClient { |
30 public: | 29 public: |
31 MockChromeClient() : m_hasScheduledAnimation(false) { } | 30 MockChromeClient() : m_hasScheduledAnimation(false) { } |
32 | 31 |
33 // ChromeClient | 32 // ChromeClient |
34 GraphicsLayerFactory* graphicsLayerFactory() const override | |
35 { | |
36 return FakeGraphicsLayerFactory::instance(); | |
37 } | |
38 MOCK_METHOD1(didPaint, void(const PaintArtifact&)); | 33 MOCK_METHOD1(didPaint, void(const PaintArtifact&)); |
39 MOCK_METHOD2(attachRootGraphicsLayer, void(GraphicsLayer*, LocalFrame* local
Root)); | 34 MOCK_METHOD2(attachRootGraphicsLayer, void(GraphicsLayer*, LocalFrame* local
Root)); |
40 MOCK_METHOD2(setToolTip, void(const String&, TextDirection)); | 35 MOCK_METHOD2(setToolTip, void(const String&, TextDirection)); |
41 | 36 |
42 void scheduleAnimation(Widget*) override { m_hasScheduledAnimation = true; } | 37 void scheduleAnimation(Widget*) override { m_hasScheduledAnimation = true; } |
43 bool m_hasScheduledAnimation; | 38 bool m_hasScheduledAnimation; |
44 }; | 39 }; |
45 | 40 |
46 class FrameViewTestBase : public testing::Test { | 41 class FrameViewTestBase : public testing::Test { |
47 protected: | 42 protected: |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 { | 150 { |
156 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); |
157 document().view()->updateAllLifecyclePhases(); | 152 document().view()->updateAllLifecyclePhases(); |
158 | 153 |
159 EXPECT_CALL(chromeClient(), setToolTip(String(), _)); | 154 EXPECT_CALL(chromeClient(), setToolTip(String(), _)); |
160 document().view()->setScrollPosition(DoublePoint(1, 1), UserScroll); | 155 document().view()->setScrollPosition(DoublePoint(1, 1), UserScroll); |
161 } | 156 } |
162 | 157 |
163 } // namespace | 158 } // namespace |
164 } // namespace blink | 159 } // namespace blink |
OLD | NEW |