| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 | 1003 |
| 1004 LayoutObject* navbar = frame()->document()->getElementById("navbar")->layout
Object(); | 1004 LayoutObject* navbar = frame()->document()->getElementById("navbar")->layout
Object(); |
| 1005 | 1005 |
| 1006 EXPECT_FALSE(navbar->needsLayout()); | 1006 EXPECT_FALSE(navbar->needsLayout()); |
| 1007 | 1007 |
| 1008 frame()->view()->resize(IntSize(500, 200)); | 1008 frame()->view()->resize(IntSize(500, 200)); |
| 1009 | 1009 |
| 1010 EXPECT_TRUE(navbar->needsLayout()); | 1010 EXPECT_TRUE(navbar->needsLayout()); |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 class MockWebFrameClient : public WebFrameClient { | 1013 class MockWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
| 1014 public: | 1014 public: |
| 1015 MOCK_METHOD1(showContextMenu, void(const WebContextMenuData&)); | 1015 MOCK_METHOD1(showContextMenu, void(const WebContextMenuData&)); |
| 1016 MOCK_METHOD1(didChangeScrollOffset, void(WebLocalFrame*)); | 1016 MOCK_METHOD1(didChangeScrollOffset, void(WebLocalFrame*)); |
| 1017 }; | 1017 }; |
| 1018 | 1018 |
| 1019 MATCHER_P2(ContextMenuAtLocation, x, y, | 1019 MATCHER_P2(ContextMenuAtLocation, x, y, |
| 1020 std::string(negation ? "is" : "isn't") | 1020 std::string(negation ? "is" : "isn't") |
| 1021 + " at expected location [" | 1021 + " at expected location [" |
| 1022 + PrintToString(x) + ", " + PrintToString(y) + "]") | 1022 + PrintToString(x) + ", " + PrintToString(y) + "]") |
| 1023 { | 1023 { |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 webViewImpl()->handleInputEvent(pinchUpdate); | 1740 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1741 | 1741 |
| 1742 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1742 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
| 1743 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1743 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1744 | 1744 |
| 1745 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1745 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
| 1746 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1746 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1747 } | 1747 } |
| 1748 | 1748 |
| 1749 } // namespace | 1749 } // namespace |
| OLD | NEW |