summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/marionette/interaction.js50
-rw-r--r--testing/marionette/listener.js4
-rw-r--r--testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini14
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini22
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini21
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini18
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini18
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini4
-rw-r--r--testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini13
-rw-r--r--testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini20
10 files changed, 54 insertions, 130 deletions
diff --git a/testing/marionette/interaction.js b/testing/marionette/interaction.js
index c8275665d..2392485d7 100644
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -76,6 +76,30 @@ const SELECTED_PROPERTY_SUPPORTED_XUL = new Set([
"TAB",
]);
+/**
+ * Common form controls that user can change the value property interactively.
+ */
+const COMMON_FORM_CONTROLS = new Set([
+ "input",
+ "textarea",
+ "select",
+]);
+
+/**
+ * Input elements that do not fire "input" and "change" events when value
+ * property changes.
+ */
+const INPUT_TYPES_NO_EVENT = new Set([
+ "checkbox",
+ "radio",
+ "file",
+ "hidden",
+ "image",
+ "reset",
+ "button",
+ "submit",
+]);
+
this.interaction = {};
/**
@@ -339,6 +363,32 @@ interaction.uploadFile = function (el, path) {
};
/**
+ * Sets a form element's value.
+ *
+ * @param {DOMElement} el
+ * An form element, e.g. input, textarea, etc.
+ * @param {string} value
+ * The value to be set.
+ *
+ * @throws TypeError
+ * If |el| is not an supported form element.
+ */
+interaction.setFormControlValue = function* (el, value) {
+ if (!COMMON_FORM_CONTROLS.has(el.localName)) {
+ throw new TypeError("This function is for form elements only");
+ }
+
+ el.value = value;
+
+ if (INPUT_TYPES_NO_EVENT.has(el.type)) {
+ return;
+ }
+
+ event.input(el);
+ event.change(el);
+};
+
+/**
* Send keys to element.
*
* @param {DOMElement|XULElement} el
diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js
index b64eb378d..619ac249d 100644
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -30,6 +30,7 @@ Cu.import("chrome://marionette/content/session.js");
Cu.import("chrome://marionette/content/simpletest.js");
Cu.import("resource://gre/modules/FileUtils.jsm");
+Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -1465,6 +1466,9 @@ function* sendKeysToElement(id, val) {
if (el.type == "file") {
let path = val.join("");
yield interaction.uploadFile(el, path);
+ } else if ((el.type == "date" || el.type == "time") &&
+ Preferences.get("dom.forms.datetime")) {
+ yield interaction.setFormControlValue(el, val);
} else {
yield interaction.sendKeysToElement(
el, val, false, capabilities.get("moz:accessibilityChecks"));
diff --git a/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini b/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini
index 27927b1e9..8c4cddf9c 100644
--- a/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini
+++ b/testing/web-platform/meta/fetch/api/headers/headers-basic.html.ini
@@ -1,17 +1,3 @@
[headers-basic.html]
type: testharness
- [Check keys method]
- expected: FAIL
-
- [Check values method]
- expected: FAIL
-
- [Check entries method]
- expected: FAIL
-
- [Check Symbol.iterator method]
- expected: FAIL
-
- [Check forEach method]
- expected: FAIL
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini
index a8247d5a0..23bd8642c 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-checkValidity.html.ini
@@ -32,25 +32,3 @@
[[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an overflow]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an overflow (in a form)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an underflow]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an underflow (in a form)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch (in a form)]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini
index 223667997..5b373cfee 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-reportValidity.html.ini
@@ -39,24 +39,3 @@
[[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL
- [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an overflow]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an overflow (in a form)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an underflow]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from an underflow (in a form)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] suffering from a step mismatch (in a form)]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini
index 6af2a360e..d8c650632 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html.ini
@@ -3,21 +3,3 @@
[[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL
- [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is greater than max]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 1 digit)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 2 digits)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is greater than max(with millisecond in 3 digits)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is greater than max(Year is 10000 should be valid)]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini
index 344ee0039..87f6f964e 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html.ini
@@ -3,21 +3,3 @@
[[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL
- [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is less than min]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 1 digit)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 2 digits)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is less than min(with millisecond in 3 digits)]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value is less than min(Year is 10000 should be valid)]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini
index 0c33bdcbe..527760e60 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html.ini
@@ -2,7 +2,3 @@
type: testharness
[[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The value must mismatch the step]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini
index 1cddcd033..8eb7940d9 100644
--- a/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini
+++ b/testing/web-platform/meta/html/semantics/forms/constraints/form-validation-validity-valid.html.ini
@@ -23,16 +23,3 @@
[[INPUT in MONTH status\] validity.valid must be false if validity.stepMismatch is true]
expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] The datetime-local type must be supported.]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.rangeOverflow is true]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.rangeUnderflow is true]
- expected: FAIL
-
- [[INPUT in DATETIME-LOCAL status\] validity.valid must be false if validity.stepMismatch is true]
- expected: FAIL
-
diff --git a/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini b/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini
deleted file mode 100644
index 5e2525ac2..000000000
--- a/testing/web-platform/meta/html/semantics/selectors/pseudo-classes/inrange-outofrange.html.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[inrange-outofrange.html]
- type: testharness
- [':in-range' matches all elements that are candidates for constraint validation, have range limitations, and that are neither suffering from an underflow nor suffering from an overflow]
- expected: FAIL
-
- [':in-range' update number1's value < min]
- expected: FAIL
-
- [':in-range' update number3's min < value]
- expected: FAIL
-
- [':out-of-range' matches all elements that are candidates for constraint validation, have range limitations, and that are either suffering from an underflow or suffering from an overflow]
- expected: FAIL
-
- [':out-of-range' update number1's value < min]
- expected: FAIL
-
- [':out-of-range' update number3's min < value]
- expected: FAIL
-