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

Unified Diff: chrome/renderer/external_popup_menu_unittest.cc

Issue 5275001: Adding a test to validate that we don't crash on empty selects. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years, 1 month 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: chrome/renderer/external_popup_menu_unittest.cc
diff --git a/chrome/renderer/external_popup_menu_unittest.cc b/chrome/renderer/external_popup_menu_unittest.cc
index 9595baeac9cdf784bc5c0e7d1da0ba1a953d3006..029903685c1baa5bd359fbe686b6eea7f7cec174 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() {}
« 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