Bug 1397983: Fix a test that was relying on getting a chrome-only node via activeElement. r?smaug draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 12 Sep 2017 11:32:01 +0200
changeset 662947 b0feef65676cf3218601cb8a2772b4b6eda4029b
parent 662946 40da9d2c7739227fed8f58d615ce34795ec3d238
child 731030 4198a0bf1f4085caffef0368ee37ece5dddf9593
push id79252
push userbmo:emilio@crisal.io
push dateTue, 12 Sep 2017 09:40:33 +0000
reviewerssmaug
bugs1397983
milestone57.0a1
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
toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
--- 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");