summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 19:30:44 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-01 19:30:44 +0000
commit92ccbddc2fff4fe5afd5b7552f419adfa9d3b877 (patch)
tree99da1c04806241b40701a3fefd9d8c18c8f2d62a
parent10949a83588a0cf94168644388238aab76b80332 (diff)
downloadchromium_src-92ccbddc2fff4fe5afd5b7552f419adfa9d3b877.zip
chromium_src-92ccbddc2fff4fe5afd5b7552f419adfa9d3b877.tar.gz
chromium_src-92ccbddc2fff4fe5afd5b7552f419adfa9d3b877.tar.bz2
Adding a test to validate that we don't crash on empty selects.
That bug is fixed on the WebKit side with: https://bugs.webkit.org/show_bug.cgi?id=49937 BUG=63774 TEST=On Mac, open a page with a select with not items (<select></select>). Click on the select, nothing should happen. Review URL: http://codereview.chromium.org/5275001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67886 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/external_popup_menu_unittest.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/renderer/external_popup_menu_unittest.cc b/chrome/renderer/external_popup_menu_unittest.cc
index 9595bae..0299036 100644
--- a/chrome/renderer/external_popup_menu_unittest.cc
+++ b/chrome/renderer/external_popup_menu_unittest.cc
@@ -15,6 +15,7 @@
namespace {
const char* const kSelectID = "mySelect";
+const char* const kEmptySelectID = "myEmptySelect";
} // namespace
@@ -31,6 +32,8 @@ class ExternalPopupMenuTest : public RenderViewTest {
" <option>zero</option>"
" <option selected='1'>one</option>"
" <option>two</option>"
+ "</select>"
+ "<select id='myEmptySelect'>"
"</select>";
if (ShouldRemoveSelectOnChange()) {
html += "<script>"
@@ -109,6 +112,12 @@ TEST_F(ExternalPopupMenuTest, ShowPopupThenNavigate) {
view_->OnSelectPopupMenuItem(-1);
}
+// An empty select should not cause a crash when clicked.
+// http://crbug.com/63774
+TEST_F(ExternalPopupMenuTest, EmptySelect) {
+ EXPECT_TRUE(SimulateElementClick(kEmptySelectID));
+}
+
class ExternalPopupMenuRemoveTest : public ExternalPopupMenuTest {
public:
ExternalPopupMenuRemoveTest() {}