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

Unified Diff: content/renderer/external_popup_menu_browsertest.cc

Issue 475733002: Test case modified to check against the item count in ExternalPopupMenu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac Build Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/external_popup_menu_browsertest.cc
diff --git a/content/renderer/external_popup_menu_browsertest.cc b/content/renderer/external_popup_menu_browsertest.cc
index f17971c3c8f9ba75263cda098ebccd7721736dcf..1152435f426c98f19776a3166eea88f9c0d1ce11 100644
--- a/content/renderer/external_popup_menu_browsertest.cc
+++ b/content/renderer/external_popup_menu_browsertest.cc
@@ -180,9 +180,21 @@ class ExternalPopupMenuDisplayNoneTest : public ExternalPopupMenuTest {
};
TEST_F(ExternalPopupMenuDisplayNoneTest, SelectItem) {
+ IPC::TestSink& sink = render_thread_->sink();
+
// Click the text field once to show the popup.
EXPECT_TRUE(SimulateElementClick(kSelectID));
+ // Read the message sent to browser to show the popup menu.
+ const IPC::Message* message =
+ sink.GetUniqueMessageMatching(FrameHostMsg_ShowPopup::ID);
+ ASSERT_TRUE(message != NULL);
+ Tuple1<FrameHostMsg_ShowPopup_Params> param;
+ FrameHostMsg_ShowPopup::Read(message, &param);
+ // Number of items should match item count minus the number
+ // of "display: none" items.
+ ASSERT_EQ(5U, param.a.popup_items.size());
+
// Select index 1 item. This should select item with index 2,
// skipping the item with 'display: none'
frame()->OnSelectPopupMenuItem(1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698