Commit 9ff8ce36 authored by sudarshan.p's avatar sudarshan.p Committed by Commit bot

Test case modified to check against the item count in ExternalPopupMenu

This is a modified due to the regression caused by
https://codereview.chromium.org/415343003/. The test case now checks the
number of items in the menu list to not include items with "display: none"

[1] https://codereview.chromium.org/475723002/ patch that fixes the regression.

BUG=398051,403299
R=tkent

Review URL: https://codereview.chromium.org/475733002

Cr-Commit-Position: refs/heads/master@{#293119}
parent a912b886
...@@ -180,9 +180,21 @@ class ExternalPopupMenuDisplayNoneTest : public ExternalPopupMenuTest { ...@@ -180,9 +180,21 @@ class ExternalPopupMenuDisplayNoneTest : public ExternalPopupMenuTest {
}; };
TEST_F(ExternalPopupMenuDisplayNoneTest, SelectItem) { TEST_F(ExternalPopupMenuDisplayNoneTest, SelectItem) {
IPC::TestSink& sink = render_thread_->sink();
// Click the text field once to show the popup. // Click the text field once to show the popup.
EXPECT_TRUE(SimulateElementClick(kSelectID)); 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, // Select index 1 item. This should select item with index 2,
// skipping the item with 'display: none' // skipping the item with 'display: none'
frame()->OnSelectPopupMenuItem(1); frame()->OnSelectPopupMenuItem(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment