Bug 1548111 - Fix intermittent failure in browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js by ignoring spurious resize events. r=mak

After many retriggers on try, this test is now not failing at all, so hopefully this fixes both bug 1548111 and bug 1562416 for good. https://treeherder.mozilla.org/#/jobs?repo=try&revision=442628a48a649ade02b2ab1e58b1fc5bf5653306

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Drew Willcoxon 2019-07-04 10:02:26 +00:00
Родитель 7e4d19b009
Коммит 431db16086
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -865,6 +865,7 @@ class UrlbarView {
_on_popupshowing() {
this.window.addEventListener("resize", this);
this._windowOuterWidth = this.window.outerWidth;
}
_on_popupshown() {
@ -880,6 +881,14 @@ class UrlbarView {
}
_on_resize() {
if (this._windowOuterWidth == this.window.outerWidth) {
// Sometimes a resize event is fired when the window's size doesn't
// actually change; at least, browser_tabMatchesInAwesomebar.js triggers
// it intermittently, which causes that test to hang or fail. Ignore
// those events.
return;
}
// Close the popup as it would be wrongly sized. This can
// happen when using special OS resize functions like Win+Arrow.
this.close();