Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: third_party/WebKit/Source/web/ExternalPopupMenuTest.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "web/ExternalPopupMenu.h" 5 #include "web/ExternalPopupMenu.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/dom/NodeComputedStyle.h" 9 #include "core/dom/NodeComputedStyle.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 loadFrame("select_mid_screen.html"); 144 loadFrame("select_mid_screen.html");
145 145
146 webView()->resize(WebSize(100, 100)); 146 webView()->resize(WebSize(100, 100));
147 webView()->updateAllLifecyclePhases(); 147 webView()->updateAllLifecyclePhases();
148 148
149 HTMLSelectElement* select = toHTMLSelectElement( 149 HTMLSelectElement* select = toHTMLSelectElement(
150 mainFrame()->frame()->document()->getElementById("select")); 150 mainFrame()->frame()->document()->getElementById("select"));
151 LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject()); 151 LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject());
152 ASSERT_TRUE(menuList); 152 ASSERT_TRUE(menuList);
153 153
154 VisualViewport& visualViewport = 154 VisualViewport& visualViewport = webView()->page()->visualViewport();
155 webView()->page()->frameHost().visualViewport();
156 155
157 IntRect rectInDocument = menuList->absoluteBoundingBoxRect(); 156 IntRect rectInDocument = menuList->absoluteBoundingBoxRect();
158 157
159 constexpr int scaleFactor = 2; 158 constexpr int scaleFactor = 2;
160 ScrollOffset scrollDelta(20, 30); 159 ScrollOffset scrollDelta(20, 30);
161 160
162 const int expectedX = 161 const int expectedX =
163 (rectInDocument.x() - scrollDelta.width()) * scaleFactor; 162 (rectInDocument.x() - scrollDelta.width()) * scaleFactor;
164 const int expectedY = 163 const int expectedY =
165 (rectInDocument.y() - scrollDelta.height()) * scaleFactor; 164 (rectInDocument.y() - scrollDelta.height()) * scaleFactor;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 227
229 WebExternalPopupMenuClient* client = 228 WebExternalPopupMenuClient* client =
230 static_cast<ExternalPopupMenu*>(select->popup()); 229 static_cast<ExternalPopupMenu*>(select->popup());
231 WebVector<int> indices; 230 WebVector<int> indices;
232 client->didAcceptIndices(indices); 231 client->didAcceptIndices(indices);
233 EXPECT_FALSE(select->popupIsVisible()); 232 EXPECT_FALSE(select->popupIsVisible());
234 EXPECT_EQ(-1, select->selectedIndex()); 233 EXPECT_EQ(-1, select->selectedIndex());
235 } 234 }
236 235
237 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/DevToolsEmulator.cpp ('k') | third_party/WebKit/Source/web/InspectorOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698