mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 14:20:14 +02:00
MozReview-Commit-ID: KhCW1n9LDka --HG-- extra : rebase_source : b191ba773efaefea3a5d2047cebb40f44f076010
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
/* eslint-disable mozilla/no-cpows-in-tests */
|
|
|
|
function whenMainPaneLoadedFinished() {
|
|
return new Promise(function(resolve, reject) {
|
|
const topic = "main-pane-loaded";
|
|
Services.obs.addObserver(function observer(aSubject) {
|
|
Services.obs.removeObserver(observer, topic);
|
|
resolve();
|
|
}, topic);
|
|
});
|
|
}
|
|
|
|
// Temporary test for an experimental new localization API.
|
|
// See bug 1402069 for details.
|
|
add_task(async function() {
|
|
// The string is used only when `browserTabsRemoteAutostart` is true
|
|
if (!Services.appinfo.browserTabsRemoteAutostart) {
|
|
ok(true, "fake test to avoid harness complaining");
|
|
return;
|
|
}
|
|
|
|
await Promise.all([
|
|
openPreferencesViaOpenPreferencesAPI("general", {leaveOpen: true}),
|
|
whenMainPaneLoadedFinished(),
|
|
]);
|
|
|
|
let doc = gBrowser.contentDocument;
|
|
await doc.l10n.ready;
|
|
|
|
let processCountPref = doc.getElementById("dom.ipc.processCount");
|
|
let defaultProcessCount = processCountPref.defaultValue;
|
|
|
|
let [ msg ] = await doc.l10n.formatMessages([
|
|
["default-content-process-count", { num: defaultProcessCount }]
|
|
]);
|
|
|
|
let elem = doc.querySelector(
|
|
`#contentProcessCount > menupopup > menuitem[value="${defaultProcessCount}"]`);
|
|
|
|
Assert.deepEqual(msg, {
|
|
value: null,
|
|
attrs: [
|
|
["label", elem.getAttribute("label")]
|
|
]
|
|
});
|
|
|
|
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
|
});
|