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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp

Issue 2103663006: Update a comment and fix a possible crash in HTMLSelectElement::setRecalcListItems. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp
index f24144eaf158313da3e4cf038faaa687493c2caf..1b94a3dd5db94c443c1cc293f884e4e0c4eed236 100644
--- a/third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSelectElementTest.cpp
@@ -341,4 +341,13 @@ TEST_F(HTMLSelectElementTest, DefaultToolTip)
EXPECT_EQ(String(), optgroup->defaultToolTip());
}
+TEST_F(HTMLSelectElementTest, SetRecalcListItemsByOptgroupRemoval)
+{
+ document().documentElement()->setInnerHTML("<select><optgroup><option>sub1</option><option>sub2</option></optgroup></select>", ASSERT_NO_EXCEPTION);
+ document().view()->updateAllLifecyclePhases();
+ HTMLSelectElement* select = toHTMLSelectElement(document().body()->firstChild());
+ select->setInnerHTML("", ASSERT_NO_EXCEPTION);
+ // PASS if setInnerHTML didn't have a check failure.
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698