| 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/BrowserControls.h" | 8 #include "core/frame/BrowserControls.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/LocalFrameView.h" | 10 #include "core/frame/LocalFrameView.h" |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 class MockWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 1107 class MockWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
| 1108 public: | 1108 public: |
| 1109 MOCK_METHOD1(ShowContextMenu, void(const WebContextMenuData&)); | 1109 MOCK_METHOD1(ShowContextMenu, void(const WebContextMenuData&)); |
| 1110 MOCK_METHOD0(DidChangeScrollOffset, void()); | 1110 MOCK_METHOD0(DidChangeScrollOffset, void()); |
| 1111 }; | 1111 }; |
| 1112 | 1112 |
| 1113 MATCHER_P2(ContextMenuAtLocation, | 1113 MATCHER_P2(ContextMenuAtLocation, |
| 1114 x, | 1114 x, |
| 1115 y, | 1115 y, |
| 1116 std::string(negation ? "is" : "isn't") + " at expected location [" + | 1116 std::string(negation ? "is" : "isn't") + " at expected location [" + |
| 1117 PrintToString(x) + | 1117 PrintToString(x) + ", " + PrintToString(y) + "]") { |
| 1118 ", " + | |
| 1119 PrintToString(y) + | |
| 1120 "]") { | |
| 1121 return arg.mouse_position.x == x && arg.mouse_position.y == y; | 1118 return arg.mouse_position.x == x && arg.mouse_position.y == y; |
| 1122 } | 1119 } |
| 1123 | 1120 |
| 1124 // Test that the context menu's location is correct in the presence of visual | 1121 // Test that the context menu's location is correct in the presence of visual |
| 1125 // viewport offset. | 1122 // viewport offset. |
| 1126 TEST_P(VisualViewportTest, TestContextMenuShownInCorrectLocation) { | 1123 TEST_P(VisualViewportTest, TestContextMenuShownInCorrectLocation) { |
| 1127 InitializeWithDesktopSettings(); | 1124 InitializeWithDesktopSettings(); |
| 1128 WebViewImpl()->Resize(IntSize(200, 300)); | 1125 WebViewImpl()->Resize(IntSize(200, 300)); |
| 1129 | 1126 |
| 1130 RegisterMockedHttpURLLoad("200-by-300.html"); | 1127 RegisterMockedHttpURLLoad("200-by-300.html"); |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 " margin: 0px;" | 2429 " margin: 0px;" |
| 2433 " }" | 2430 " }" |
| 2434 " div { height:110vh; width: 110vw; }" | 2431 " div { height:110vh; width: 110vw; }" |
| 2435 "</style>" | 2432 "</style>" |
| 2436 "<div></div>", | 2433 "<div></div>", |
| 2437 base_url); | 2434 base_url); |
| 2438 } | 2435 } |
| 2439 | 2436 |
| 2440 } // namespace | 2437 } // namespace |
| 2441 } // namespace blink | 2438 } // namespace blink |
| OLD | NEW |