OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 #include "web/ExternalPopupMenu.h" | 6 #include "web/ExternalPopupMenu.h" |
7 | 7 |
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 WebViewImpl* webView() const { return m_helper.webViewImpl(); } | 124 WebViewImpl* webView() const { return m_helper.webViewImpl(); } |
125 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli
ent; } | 125 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli
ent; } |
126 WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFr
ameImpl(); } | 126 WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFr
ameImpl(); } |
127 | 127 |
128 private: | 128 private: |
129 std::string m_baseURL; | 129 std::string m_baseURL; |
130 FrameTestHelpers::TestWebViewClient m_webViewClient; | 130 FrameTestHelpers::TestWebViewClient m_webViewClient; |
131 ExternalPopupMenuWebFrameClient m_webFrameClient; | 131 ExternalPopupMenuWebFrameClient m_webFrameClient; |
132 FrameTestHelpers::WebViewHelper m_helper; | 132 FrameTestHelpers::WebViewHelper m_helper; |
| 133 FrameTestHelpers::UseMockScrollbarSettings m_mockScrollbarSettings; |
133 }; | 134 }; |
134 | 135 |
135 TEST_F(ExternalPopupMenuTest, PopupAccountsForVisualViewportOffset) | 136 TEST_F(ExternalPopupMenuTest, PopupAccountsForVisualViewportOffset) |
136 { | 137 { |
137 registerMockedURLLoad("select_mid_screen.html"); | 138 registerMockedURLLoad("select_mid_screen.html"); |
138 loadFrame("select_mid_screen.html"); | 139 loadFrame("select_mid_screen.html"); |
139 | 140 |
140 webView()->resize(WebSize(100, 100)); | 141 webView()->resize(WebSize(100, 100)); |
141 webView()->layout(); | 142 webView()->layout(); |
142 | 143 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 ASSERT_TRUE(select->popupIsVisible()); | 212 ASSERT_TRUE(select->popupIsVisible()); |
212 | 213 |
213 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select-
>popup()); | 214 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select-
>popup()); |
214 WebVector<int> indices; | 215 WebVector<int> indices; |
215 client->didAcceptIndices(indices); | 216 client->didAcceptIndices(indices); |
216 EXPECT_FALSE(select->popupIsVisible()); | 217 EXPECT_FALSE(select->popupIsVisible()); |
217 EXPECT_EQ(-1, select->selectedIndex()); | 218 EXPECT_EQ(-1, select->selectedIndex()); |
218 } | 219 } |
219 | 220 |
220 } // namespace blink | 221 } // namespace blink |
OLD | NEW |