Bug 1397098 - Wait for the content pref update after changing zoom level. r=adw

This commit is contained in:
Tooru Fujisawa 2018-03-25 17:23:48 +09:00
Родитель 3e69964c92
Коммит 8e58247d0d
2 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -28,7 +28,6 @@ skip-if = !e10s # Pref and test only relevant for e10s.
[browser_pinnedTabs_closeByKeyboard.js]
[browser_positional_attributes.js]
[browser_preloadedBrowser_zoom.js]
skip-if = !debug && (os == 'win' && (os_version == '6.1')) # Bug 1397098
[browser_reload_deleted_file.js]
skip-if = (debug && os == 'mac') || (debug && os == 'linux' && bits == 64) #Bug 1421183, disabled on Linux/OSX for leaked windows
[browser_tabswitch_updatecommands.js]

Просмотреть файл

@ -38,6 +38,21 @@ async function zoomNewTab(changeZoom, message) {
const level = tab.linkedBrowser.fullZoom;
BrowserTestUtils.removeTab(tab);
// Wait for the the update of the full-zoom content pref value, that happens
// asynchronously after changing the zoom level.
let cps2 = Cc["@mozilla.org/content-pref/service;1"].
getService(Ci.nsIContentPrefService2);
await BrowserTestUtils.waitForCondition(() => {
return new Promise(resolve => {
cps2.getByDomainAndName("about:newtab", "browser.content.full-zoom", null, {
handleResult(pref) {
resolve(level == pref.value);
},
handleCompletion() {},
});
});
});
await checkPreloadedZoom(level, `${message}: ${level}`);
}