Bug 1529931 - Avoid autofill flicker: Fix reflow performance tests. r=mconley

Replace a couple of popup methods so that they call dirtyFrame(), so that reflows happen deterministically.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Drew Willcoxon 2019-03-20 16:08:21 +00:00
Родитель 674a2ade96
Коммит 66b8f1c131
3 изменённых файлов: 36 добавлений и 30 удалений

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

@ -14,20 +14,6 @@
/* These reflows happen only the first time the panel opens. */ /* These reflows happen only the first time the panel opens. */
const EXPECTED_REFLOWS_FIRST_OPEN = [ const EXPECTED_REFLOWS_FIRST_OPEN = [
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
// 1359989, which was filed against the legacy awesomebar but applies here too
// because it seems to be caused by platform code.
{
stack: [
"_openPanel@resource:///modules/UrlbarView.jsm",
"onQueryResults@resource:///modules/UrlbarView.jsm",
"_notify@resource:///modules/UrlbarController.jsm",
"receiveResults@resource:///modules/UrlbarController.jsm",
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
"add@resource:///modules/UrlbarProvidersManager.jsm",
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
],
},
{ {
stack: [ stack: [
"__rebuild@chrome://browser/content/search/search-one-offs.js", "__rebuild@chrome://browser/content/search/search-one-offs.js",
@ -46,6 +32,15 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
*/ */
], ],
}, },
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
// 1359989, which was filed against the legacy awesomebar but applies here too
// because it seems to be caused by platform code.
{
stack: [
"_openPanel@resource:///modules/UrlbarView.jsm",
"onQueryResults@resource:///modules/UrlbarView.jsm",
],
},
]; ];
add_task(async function quantumbar() { add_task(async function quantumbar() {

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

@ -14,17 +14,6 @@
/* These reflows happen only the first time the panel opens. */ /* These reflows happen only the first time the panel opens. */
const EXPECTED_REFLOWS_FIRST_OPEN = [ const EXPECTED_REFLOWS_FIRST_OPEN = [
{
stack: [
"_openPanel@resource:///modules/UrlbarView.jsm",
"onQueryResults@resource:///modules/UrlbarView.jsm",
"_notify@resource:///modules/UrlbarController.jsm",
"receiveResults@resource:///modules/UrlbarController.jsm",
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
"add@resource:///modules/UrlbarProvidersManager.jsm",
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
],
},
{ {
stack: [ stack: [
"__rebuild@chrome://browser/content/search/search-one-offs.js", "__rebuild@chrome://browser/content/search/search-one-offs.js",
@ -43,6 +32,15 @@ const EXPECTED_REFLOWS_FIRST_OPEN = [
*/ */
], ],
}, },
// This is the this.panel.openPopup() call in UrlbarView._openPanel. See bug
// 1359989, which was filed against the legacy awesomebar but applies here too
// because it seems to be caused by platform code.
{
stack: [
"_openPanel@resource:///modules/UrlbarView.jsm",
"onQueryResults@resource:///modules/UrlbarView.jsm",
],
},
]; ];
/* These reflows happen every time the panel opens. */ /* These reflows happen every time the panel opens. */
@ -54,11 +52,6 @@ const EXPECTED_REFLOWS_SECOND_OPEN = [
stack: [ stack: [
"_openPanel@resource:///modules/UrlbarView.jsm", "_openPanel@resource:///modules/UrlbarView.jsm",
"onQueryResults@resource:///modules/UrlbarView.jsm", "onQueryResults@resource:///modules/UrlbarView.jsm",
"_notify@resource:///modules/UrlbarController.jsm",
"receiveResults@resource:///modules/UrlbarController.jsm",
"notifyResults@resource:///modules/UrlbarProvidersManager.jsm",
"add@resource:///modules/UrlbarProvidersManager.jsm",
"onSearchResult@resource:///modules/UrlbarProviderUnifiedComplete.jsm",
], ],
}, },
]; ];

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

@ -693,6 +693,24 @@ async function runUrlbarTest(useAwesomebar,
fn(); fn();
}, ms); }, ms);
}; };
} else {
let popup = URLBar.view;
let oldOnQueryResults = popup.onQueryResults.bind(popup);
let oldOnQueryFinished = popup.onQueryFinished.bind(popup);
// We need to invalidate the frame tree outside of the normal
// mechanism since invalidations and result additions to the
// URL bar occur without firing JS events (which is how we
// normally know to dirty the frame tree).
popup.onQueryResults = (context) => {
dirtyFrame(win);
oldOnQueryResults(context);
};
popup.onQueryFinished = (context) => {
dirtyFrame(win);
oldOnQueryFinished(context);
};
} }
let waitExtra = async () => { let waitExtra = async () => {