Bug 1447667 - Use a different element in preferences search test. r?jaws
MozReview-Commit-ID: 94HVZ9zLhH5
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
@@ -65,64 +65,64 @@ add_task(async function() {
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
/**
* Test that we search using `search-l10n-ids`.
*
- * The test uses element `browserContainersSettings` and
+ * The test uses element `showUpdateHistory` and
* l10n id `language-and-appearance-header` and expects the element
* to be matched on the first word from the l10n id value ("Language" in en-US).
*/
add_task(async function() {
let l10nId = "language-and-appearance-header";
await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
// First, lets make sure that the element is not matched without
// `search-l10n-ids`.
{
let searchInput = gBrowser.contentDocument.getElementById("searchInput");
- let bcsElem = gBrowser.contentDocument.getElementById("browserContainersSettings");
+ let suhElem = gBrowser.contentDocument.getElementById("showUpdateHistory");
is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
"Search input should be focused when visiting preferences");
- ok(!bcsElem.getAttribute("search-l10n-ids").includes(l10nId),
- "browserContainersSettings element should not contain the l10n id here.");
+ ok(!suhElem.getAttribute("search-l10n-ids").includes(l10nId),
+ "showUpdateHistory element should not contain the l10n id here.");
let query = "Language";
let searchCompletedPromise = BrowserTestUtils.waitForEvent(
gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
EventUtils.sendString(query);
await searchCompletedPromise;
- is_element_hidden(bcsElem, "browserContainersSettings should not be in search results");
+ is_element_hidden(suhElem, "showUpdateHistory should not be in search results");
}
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
// Now, let's add the l10n id to the element and perform the same search again.
await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
{
let searchInput = gBrowser.contentDocument.getElementById("searchInput");
is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
"Search input should be focused when visiting preferences");
- let bcsElem = gBrowser.contentDocument.getElementById("browserContainersSettings");
- bcsElem.setAttribute("search-l10n-ids", l10nId);
+ let suhElem = gBrowser.contentDocument.getElementById("showUpdateHistory");
+ suhElem.setAttribute("search-l10n-ids", l10nId);
let query = "Language";
let searchCompletedPromise = BrowserTestUtils.waitForEvent(
gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
EventUtils.sendString(query);
await searchCompletedPromise;
- is_element_visible(bcsElem, "browserContainersSettings should be in search results");
+ is_element_visible(suhElem, "showUpdateHistory should be in search results");
}
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
});