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

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

Issue 1959583002: Do not open SELECT popup if the SELECT element is not in the viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: popup-menu-key-operations.html needs rebaseline Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/NodeComputedStyle.h" 8 #include "core/dom/NodeComputedStyle.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 void registerMockedURLLoad(const std::string& fileName) 115 void registerMockedURLLoad(const std::string& fileName)
116 { 116 {
117 URLTestHelpers::registerMockedURLLoad(URLTestHelpers::toKURL(m_baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/") , WebString::fromUTF8("text/html")); 117 URLTestHelpers::registerMockedURLLoad(URLTestHelpers::toKURL(m_baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/") , WebString::fromUTF8("text/html"));
118 } 118 }
119 119
120 void loadFrame(const std::string& fileName) 120 void loadFrame(const std::string& fileName)
121 { 121 {
122 FrameTestHelpers::loadFrame(mainFrame(), m_baseURL + fileName); 122 FrameTestHelpers::loadFrame(mainFrame(), m_baseURL + fileName);
123 webView()->resize(WebSize(800, 600));
124 webView()->updateAllLifecyclePhases();
123 } 125 }
124 126
125 WebViewImpl* webView() const { return m_helper.webViewImpl(); } 127 WebViewImpl* webView() const { return m_helper.webViewImpl(); }
126 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli ent; } 128 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli ent; }
127 WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFr ameImpl(); } 129 WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFr ameImpl(); }
128 130
129 private: 131 private:
130 std::string m_baseURL; 132 std::string m_baseURL;
131 FrameTestHelpers::TestWebViewClient m_webViewClient; 133 FrameTestHelpers::TestWebViewClient m_webViewClient;
132 ExternalPopupMenuWebFrameClient m_webFrameClient; 134 ExternalPopupMenuWebFrameClient m_webFrameClient;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 ASSERT_TRUE(select->popupIsVisible()); 214 ASSERT_TRUE(select->popupIsVisible());
213 215
214 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select- >popup()); 216 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select- >popup());
215 WebVector<int> indices; 217 WebVector<int> indices;
216 client->didAcceptIndices(indices); 218 client->didAcceptIndices(indices);
217 EXPECT_FALSE(select->popupIsVisible()); 219 EXPECT_FALSE(select->popupIsVisible());
218 EXPECT_EQ(-1, select->selectedIndex()); 220 EXPECT_EQ(-1, select->selectedIndex());
219 } 221 }
220 222
221 } // namespace blink 223 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698