diff options
author | sudarshan.p@samsung.com <sudarshan.p@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 19:17:12 +0000 |
---|---|---|
committer | sudarshan.p@samsung.com <sudarshan.p@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 19:18:29 +0000 |
commit | d0cd6748af2828a2800cb090c8ac7cc7743856ea (patch) | |
tree | e4474e85bc0bfd259fab7b2e3d767a177ff4a289 /content/renderer/external_popup_menu_browsertest.cc | |
parent | 8b250561af086cc3378da5381b2853af38cc26ee (diff) | |
download | chromium_src-d0cd6748af2828a2800cb090c8ac7cc7743856ea.zip chromium_src-d0cd6748af2828a2800cb090c8ac7cc7743856ea.tar.gz chromium_src-d0cd6748af2828a2800cb090c8ac7cc7743856ea.tar.bz2 |
Add content browser test for <optgroup> with 'display: none'
This patch adds the ExternalPopupMenu content browser
tests for the changes in https://codereview.chromium.org/415343003/. This
will be applicable on Mac port, as it uses
ExternalPopupMenu to show dropdown menu.
BUG=398051
R=keishi@chromium.org
Review URL: https://codereview.chromium.org/447503002
Cr-Commit-Position: refs/heads/master@{#289045}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/external_popup_menu_browsertest.cc')
-rw-r--r-- | content/renderer/external_popup_menu_browsertest.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/content/renderer/external_popup_menu_browsertest.cc b/content/renderer/external_popup_menu_browsertest.cc index a0a6a90..c29306c 100644 --- a/content/renderer/external_popup_menu_browsertest.cc +++ b/content/renderer/external_popup_menu_browsertest.cc @@ -145,4 +145,44 @@ TEST_F(ExternalPopupMenuRemoveTest, RemoveOnChange) { EXPECT_FALSE(SimulateElementClick(kSelectID)); } +class ExternalPopupMenuDisplayNoneTest : public ExternalPopupMenuTest { + public: + ExternalPopupMenuDisplayNoneTest() {} + + virtual void SetUp() { + RenderViewTest::SetUp(); + // We need to set this explictly as RenderMain is not run. + blink::WebView::setUseExternalPopupMenus(true); + + std::string html = "<select id='mySelect'>" + " <option value='zero'>zero</option>" + " <optgroup label='hide' style='display: none'>" + " <option value='one'>one</option>" + " </optgroup>" + " <option value='two'>two</option>" + " <option value='three'>three</option>" + " <option value='four'>four</option>" + " <option value='five'>five</option>" + "</select>"; + // Load the test page. + LoadHTML(html.c_str()); + + // Set a minimum size and give focus so simulated events work. + view()->webwidget()->resize(blink::WebSize(500, 500)); + view()->webwidget()->setFocus(true); + } + +}; + +TEST_F(ExternalPopupMenuDisplayNoneTest, SelectItem) { + // Click the text field once to show the popup. + EXPECT_TRUE(SimulateElementClick(kSelectID)); + + // Select index 1 item. This should select item with index 2, + // skipping the item with 'display: none' + view()->OnSelectPopupMenuItem(1); + + EXPECT_EQ(2,GetSelectedIndex()); +} + } // namespace content |