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 <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/VisualViewport.h" | 10 #include "core/frame/VisualViewport.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 WebString::FromUTF8(base_url_), testing::WebTestDataPath("popup"), | 116 WebString::FromUTF8(base_url_), testing::WebTestDataPath("popup"), |
117 WebString::FromUTF8(file_name), WebString::FromUTF8("text/html")); | 117 WebString::FromUTF8(file_name), WebString::FromUTF8("text/html")); |
118 } | 118 } |
119 | 119 |
120 void LoadFrame(const std::string& file_name) { | 120 void LoadFrame(const std::string& file_name) { |
121 FrameTestHelpers::LoadFrame(MainFrame(), base_url_ + file_name); | 121 FrameTestHelpers::LoadFrame(MainFrame(), base_url_ + file_name); |
122 WebView()->Resize(WebSize(800, 600)); | 122 WebView()->Resize(WebSize(800, 600)); |
123 WebView()->UpdateAllLifecyclePhases(); | 123 WebView()->UpdateAllLifecyclePhases(); |
124 } | 124 } |
125 | 125 |
126 WebViewImpl* WebView() const { return helper_.WebView(); } | 126 WebViewBase* WebView() const { return helper_.WebView(); } |
127 const ExternalPopupMenuWebFrameClient& Client() const { | 127 const ExternalPopupMenuWebFrameClient& Client() const { |
128 return web_frame_client_; | 128 return web_frame_client_; |
129 } | 129 } |
130 WebLocalFrameImpl* MainFrame() const { | 130 WebLocalFrameImpl* MainFrame() const { |
131 return helper_.WebView()->MainFrameImpl(); | 131 return helper_.WebView()->MainFrameImpl(); |
132 } | 132 } |
133 | 133 |
134 private: | 134 private: |
135 std::string base_url_; | 135 std::string base_url_; |
136 FrameTestHelpers::TestWebViewClient web_view_client_; | 136 FrameTestHelpers::TestWebViewClient web_view_client_; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 WebExternalPopupMenuClient* client = | 227 WebExternalPopupMenuClient* client = |
228 static_cast<ExternalPopupMenu*>(select->Popup()); | 228 static_cast<ExternalPopupMenu*>(select->Popup()); |
229 WebVector<int> indices; | 229 WebVector<int> indices; |
230 client->DidAcceptIndices(indices); | 230 client->DidAcceptIndices(indices); |
231 EXPECT_FALSE(select->PopupIsVisible()); | 231 EXPECT_FALSE(select->PopupIsVisible()); |
232 EXPECT_EQ(-1, select->selectedIndex()); | 232 EXPECT_EQ(-1, select->selectedIndex()); |
233 } | 233 } |
234 | 234 |
235 } // namespace blink | 235 } // namespace blink |
OLD | NEW |