Bug 1504157 - make onsize event triggered once; r=smaug

avoid the condition been checked twice.

Differential Revision: https://phabricator.services.mozilla.com/D18961

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Liang-Heng Chen 2019-02-07 20:34:06 +00:00
Родитель 01ca807367
Коммит 5b50bbbe4a
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -189,14 +189,14 @@ async function testWindowSizeSetting(aBrowser, aSettingWidth, aSettingHeight,
// Test inner/outerWidth.
await new Promise(resolve => {
win.onresize = () => {
win.addEventListener("resize", () => {
is(win.screen.width, input.targetWidth,
"The screen.width has a correct rounded value");
is(win.innerWidth, input.targetWidth,
"The window.innerWidth has a correct rounded value");
resolve();
};
}, { once: true });
if (input.testOuter) {
win.outerWidth = input.settingWidth;
@ -207,14 +207,14 @@ async function testWindowSizeSetting(aBrowser, aSettingWidth, aSettingHeight,
// Test inner/outerHeight.
await new Promise(resolve => {
win.onresize = () => {
win.addEventListener("resize", () => {
is(win.screen.height, input.targetHeight,
"The screen.height has a correct rounded value");
is(win.innerHeight, input.targetHeight,
"The window.innerHeight has a correct rounded value");
resolve();
};
}, { once: true });
if (input.testOuter) {
win.outerHeight = input.settingHeight;