Bug 1397983: Fix a test that was relying on getting a chrome-only node via activeElement. r?smaug
Instead, test it with the closest non-chrome-only node, which is the settings
panel.
This keeps testing what is intended to test, which is that we don't focus the
search bar accidentally.
MozReview-Commit-ID: 20jPutdfqfO
--- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
@@ -245,17 +245,17 @@ add_test(function() {
input.select();
EventUtils.synthesizeKey("b", {}, gManagerWindow);
EventUtils.synthesizeKey("a", {}, gManagerWindow);
EventUtils.synthesizeKey("r", {}, gManagerWindow);
is(input.value, "bar", "Text box should have updated value");
input.value += "\u03DE"; // Cheat to add this non-ASCII character without typing it.
EventUtils.synthesizeKey("/", {}, gManagerWindow);
is(input.value, "bar\u03DE/", "Text box should have updated value");
- is(gManagerWindow.document.getBindingParent(gManagerWindow.document.activeElement), input, "Search box should not have focus");
+ is(gManagerWindow.document.activeElement, settings[3], "Search box should not have focus");
is(Services.prefs.getStringPref("extensions.inlinesettings1.string", "wrong"), "bar\u03DE/", "String pref should have been updated");
ok(!settings[4].hasAttribute("first-row"), "Not the first row");
input = settings[4].firstElementChild;
is(input.value, "1", "Menulist should have initial value");
input.focus();
EventUtils.synthesizeKey("b", {}, gManagerWindow);
is(input.value, "2", "Menulist should have updated value");