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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |