From ec3c933ae7334e2e640b9701523feb647eee7a6e Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 27 Mar 2013 17:18:15 +0000 Subject: [PATCH] Bug 851780 - Add tests for input event. r=jwatt --- content/html/content/test/forms/Makefile.in | 1 + .../content/test/forms/test_change_event.html | 9 +- .../content/test/forms/test_input_event.html | 189 ++++++++++++++++++ 3 files changed, 191 insertions(+), 8 deletions(-) create mode 100644 content/html/content/test/forms/test_input_event.html diff --git a/content/html/content/test/forms/Makefile.in b/content/html/content/test/forms/Makefile.in index d76355c573e1..b51f387f2e05 100644 --- a/content/html/content/test/forms/Makefile.in +++ b/content/html/content/test/forms/Makefile.in @@ -57,6 +57,7 @@ MOCHITEST_FILES = \ test_submit_invalid_file.html \ submit_invalid_file.sjs \ test_input_file_picker.html \ + test_input_event.html \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/content/html/content/test/forms/test_change_event.html b/content/html/content/test/forms/test_change_event.html index e3fdf6785bc5..b3f4b57ed15a 100644 --- a/content/html/content/test/forms/test_change_event.html +++ b/content/html/content/test/forms/test_change_event.html @@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599 - +
@@ -46,7 +46,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599
   var NonTextInputChange = [0, 0, 0, 0, 0, 0];
 
   var rangeChange = 0;
-  var rangeInput = 0;
 
   var blurTestCalled = false; //Sentinel to prevent infinite loop.
 
@@ -171,27 +170,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=722599
     synthesizeKey("a", {});
     range.blur();
     is(rangeChange, 0, "Change event shouldn't be dispatched on range input element for key changes that don't change its value");
-    is(rangeInput, 0, "Input event shouldn't be dispatched on range input element for key changes that don't change its value");
     range.focus();
     synthesizeKey("VK_HOME", {});
     is(rangeChange, 0, "Change event shouldn't be dispatched on range input element for key changes until it is looses focus");
-    is(rangeInput, 1, "Input event should be dispatched on range input element for key changes");
     range.blur();
     is(rangeChange, 1, "Change event should be dispatched on range input element on blur");
-    is(rangeInput, 1, "Input event shouldn't be dispatched on range input element on blur if the value hasn't changed");
     range.focus();
     var bcr = range.getBoundingClientRect();
     var centerOfRangeX = bcr.width / 2;
     var centerOfRangeY = bcr.height / 2;
     synthesizeMouse(range, centerOfRangeX - 10, centerOfRangeY, { type: "mousedown" });
     is(rangeChange, 1, "Change event shouldn't be dispatched on range input element for mousedown");
-    is(rangeInput, 2, "Input event should be dispatched on range input element on mousedown if the value changes");
     synthesizeMouse(range, centerOfRangeX - 5, centerOfRangeY, { type: "mousemove" });
     is(rangeChange, 1, "Change event shouldn't be dispatched on range input element during drag of thumb");
-    is(rangeInput, 3, "Input event should be dispatched on range input element during a drag");
     synthesizeMouse(range, centerOfRangeX, centerOfRangeY, { type: "mouseup" });
     is(rangeChange, 2, "Change event should be dispatched on range input element at end of drag");
-    is(rangeInput, 4, "Input event should be dispatched on range input element at the end of a drag");
 
     //Input type change test.
     input = document.getElementById("input_checkbox");
diff --git a/content/html/content/test/forms/test_input_event.html b/content/html/content/test/forms/test_input_event.html
new file mode 100644
index 000000000000..3febe5b3ee24
--- /dev/null
+++ b/content/html/content/test/forms/test_input_event.html
@@ -0,0 +1,189 @@
+
+
+
+
+Test for input event
+
+
+
+
+
+Mozilla Bug 851780
+

+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+ +