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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/search/search-change-type-onsearch.html

Issue 1537313002: Fix a crash by search event handler for <input type=search incremental>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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
Index: third_party/WebKit/LayoutTests/fast/forms/search/search-change-type-onsearch.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/search/search-change-type-onsearch.html b/third_party/WebKit/LayoutTests/fast/forms/search/search-change-type-onsearch.html
new file mode 100644
index 0000000000000000000000000000000000000000..166553441529071f6e90eed35acf4c4764ba78a5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/search/search-change-type-onsearch.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<body>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input type="search" incremental>
+<script>
+var input = document.querySelector('input');
+input.onsearch = function() {
+ input.type = 'text';
+};
+
+var test = async_test('Changing the input type in search event handler should not crash.');
+test.step(function() {
+ input.offsetTop;
+ input.setRangeText('', 0, 1); // Trigger 'search' event.
+});
+setTimeout(function() { test.step(function() {
+ assert_equals(input.type, 'text');
+ test.done();
+})}, 0);
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698