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

Unified Diff: LayoutTests/fast/forms/color/input-color-onchange-event.html

Issue 513783002: Dispatch change event for input type=color when colorpicker is closed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implemented colorChooserClient support Created 6 years, 3 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
Index: LayoutTests/fast/forms/color/input-color-onchange-event.html
diff --git a/LayoutTests/fast/forms/color/input-color-onchange-event.html b/LayoutTests/fast/forms/color/input-color-onchange-event.html
index d0f53acdcf599021d928e8599eaec3144744d8a7..98688a78063aec18aa9a165adeff6651dc60d75e 100644
--- a/LayoutTests/fast/forms/color/input-color-onchange-event.html
+++ b/LayoutTests/fast/forms/color/input-color-onchange-event.html
@@ -20,8 +20,15 @@ input.style.top = '0';
input.style.width = '20px';
input.style.height = '20px';
+var onChange = 0;
+
input.onchange = function() {
- debug("value changed to " + input.value);
+ debug("change event dispatched - value changed to " + input.value);
+ onChange++;
+};
+
+input.oninput = function() {
+ debug("input event dispatched - value is: " + input.value);
};
eventSender.mouseMoveTo(10, 10);
@@ -34,10 +41,19 @@ shouldThrow("internals.selectColorInColorChooser(document, '#ff0000');");
// input.onchange should be called
internals.selectColorInColorChooser(input, '#ff0000');
+internals.endColorChooser(input);
// input.onchange should not be called
internals.selectColorInColorChooser(input, '#ff0000');
-
+internals.endColorChooser(input);
shouldBe('input.value', '"#ff0000"');
+
+debug('Change event is only dispatched, when color chooser is closed');
+onChange = 0;
+internals.selectColorInColorChooser(input, '#ff0002');
+shouldBe('onChange', '0');
+internals.endColorChooser(input);
+shouldBe('onChange', '1');
+
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698