зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
01ca807367
Коммит
5b50bbbe4a
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче