Bug 1385873 - Throw TypeError when passing XUL element to interaction.selectOption. r=automatedtester
Marionette throws a TypeError when the element is not an <option>,
and we should use the same error type when a XUL element is passed.
MozReview-Commit-ID: 3p3wPcW621f
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -277,17 +277,17 @@ function* seleniumClickElement(el, a11y)
* If <var>el</var> is a XUL element or not an <tt><option></tt>
* element.
* @throws {Error}
* If unable to find <var>el</var>'s parent <tt><select></tt>
* element.
*/
interaction.selectOption = function(el) {
if (element.isXULElement(el)) {
- throw new Error("XUL dropdowns not supported");
+ throw new TypeError("XUL dropdowns not supported");
}
if (el.localName != "option") {
throw new TypeError(pprint`Expected <option> element, got ${el}`);
}
let containerEl = element.getContainer(el);
event.mouseover(containerEl);