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

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

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 "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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 URLTestHelpers::registerMockedURLLoad(URLTestHelpers::toKURL(m_baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/") , WebString::fromUTF8("text/html")); 118 URLTestHelpers::registerMockedURLLoad(URLTestHelpers::toKURL(m_baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/") , WebString::fromUTF8("text/html"));
119 } 119 }
120 120
121 void loadFrame(const std::string& fileName) 121 void loadFrame(const std::string& fileName)
122 { 122 {
123 FrameTestHelpers::loadFrame(mainFrame(), m_baseURL + fileName); 123 FrameTestHelpers::loadFrame(mainFrame(), m_baseURL + fileName);
124 webView()->resize(WebSize(800, 600)); 124 webView()->resize(WebSize(800, 600));
125 webView()->updateAllLifecyclePhases(); 125 webView()->updateAllLifecyclePhases();
126 } 126 }
127 127
128 WebViewImpl* webView() const { return m_helper.webViewImpl(); } 128 WebViewImpl* webView() const { return m_helper.webView(); }
129 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli ent; } 129 const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameCli ent; }
130 WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFr ameImpl(); } 130 WebLocalFrameImpl* mainFrame() const { return m_helper.webView()->mainFrameI mpl(); }
131 131
132 private: 132 private:
133 std::string m_baseURL; 133 std::string m_baseURL;
134 FrameTestHelpers::TestWebViewClient m_webViewClient; 134 FrameTestHelpers::TestWebViewClient m_webViewClient;
135 ExternalPopupMenuWebFrameClient m_webFrameClient; 135 ExternalPopupMenuWebFrameClient m_webFrameClient;
136 FrameTestHelpers::WebViewHelper m_helper; 136 FrameTestHelpers::WebViewHelper m_helper;
137 }; 137 };
138 138
139 TEST_F(ExternalPopupMenuTest, PopupAccountsForVisualViewportOffset) 139 TEST_F(ExternalPopupMenuTest, PopupAccountsForVisualViewportOffset)
140 { 140 {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ASSERT_TRUE(select->popupIsVisible()); 215 ASSERT_TRUE(select->popupIsVisible());
216 216
217 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select- >popup()); 217 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(select- >popup());
218 WebVector<int> indices; 218 WebVector<int> indices;
219 client->didAcceptIndices(indices); 219 client->didAcceptIndices(indices);
220 EXPECT_FALSE(select->popupIsVisible()); 220 EXPECT_FALSE(select->popupIsVisible());
221 EXPECT_EQ(-1, select->selectedIndex()); 221 EXPECT_EQ(-1, select->selectedIndex());
222 } 222 }
223 223
224 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/PageOverlayTest.cpp » ('j') | third_party/WebKit/Source/web/WebRemoteFrameImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698