From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../test/performance/StartupContentSubframe.sys.mjs | 2 +- .../test/performance/browser_preferences_usage.js | 2 +- .../test/performance/browser_startup_content.js | 10 ++-------- .../performance/browser_startup_mainthreadio.js | 1 + .../content/test/performance/browser_tabdetach.js | 4 ++-- .../content/test/performance/browser_tabopen.js | 2 +- .../test/performance/browser_tabopen_squeeze.js | 2 +- .../browser_tabstrip_overflow_underflow.js | 4 ++-- .../content/test/performance/browser_tabswitch.js | 14 +++++++++----- .../content/test/performance/browser_windowclose.js | 2 +- .../content/test/performance/browser_windowopen.js | 2 +- browser/base/content/test/performance/head.js | 21 +++++++++------------ 12 files changed, 31 insertions(+), 35 deletions(-) (limited to 'browser/base/content/test/performance') diff --git a/browser/base/content/test/performance/StartupContentSubframe.sys.mjs b/browser/base/content/test/performance/StartupContentSubframe.sys.mjs index a78e456afb..7d2d711765 100644 --- a/browser/base/content/test/performance/StartupContentSubframe.sys.mjs +++ b/browser/base/content/test/performance/StartupContentSubframe.sys.mjs @@ -16,7 +16,7 @@ export class StartupContentSubframeParent extends JSWindowActorParent { } export class StartupContentSubframeChild extends JSWindowActorChild { - async handleEvent(event) { + async handleEvent() { // When the remote subframe is loaded, an event will be fired to this actor, // which will cause us to send the `LoadedScripts` message to the parent // process. diff --git a/browser/base/content/test/performance/browser_preferences_usage.js b/browser/base/content/test/performance/browser_preferences_usage.js index 6bc623a360..b0ff140d19 100644 --- a/browser/base/content/test/performance/browser_preferences_usage.js +++ b/browser/base/content/test/performance/browser_preferences_usage.js @@ -107,7 +107,7 @@ add_task(async function startup() { "browser.startup.record": { // This pref is accessed in Nighly and debug builds only. min: 200, - max: 400, + max: 450, }, "network.loadinfo.skip_type_assertion": { // This is accessed in debug only. diff --git a/browser/base/content/test/performance/browser_startup_content.js b/browser/base/content/test/performance/browser_startup_content.js index b0f861e47f..fac82ad990 100644 --- a/browser/base/content/test/performance/browser_startup_content.js +++ b/browser/base/content/test/performance/browser_startup_content.js @@ -57,18 +57,11 @@ const known_scripts = { ]), }; -if (!Services.appinfo.sessionHistoryInParent) { - known_scripts.modules.add( - "resource:///modules/sessionstore/ContentSessionStore.sys.mjs" - ); -} - // Items on this list *might* load when creating the process, as opposed to // items in the main list, which we expect will always load. const intermittently_loaded_scripts = { modules: new Set([ "resource://gre/modules/nsAsyncShutdown.sys.mjs", - "resource://gre/modules/sessionstore/Utils.sys.mjs", // Translations code which may be preffed on. "resource://gre/actors/TranslationsChild.sys.mjs", @@ -119,7 +112,8 @@ add_task(async function () { let mm = gBrowser.selectedBrowser.messageManager; let promise = BrowserTestUtils.waitForMessage(mm, "Test:LoadedScripts"); - // Load a custom frame script to avoid using ContentTask which loads Task.jsm + // Load a custom frame script to avoid using SpecialPowers.spawn which may + // load other modules. mm.loadFrameScript( "data:text/javascript,(" + function () { diff --git a/browser/base/content/test/performance/browser_startup_mainthreadio.js b/browser/base/content/test/performance/browser_startup_mainthreadio.js index b65ede26d5..a89a068f13 100644 --- a/browser/base/content/test/performance/browser_startup_mainthreadio.js +++ b/browser/base/content/test/performance/browser_startup_mainthreadio.js @@ -189,6 +189,7 @@ const startupPhases = { { // bug 1541601 path: "PrfDef:channel-prefs.js", + condition: !MAC, stat: 1, read: 1, close: 1, diff --git a/browser/base/content/test/performance/browser_tabdetach.js b/browser/base/content/test/performance/browser_tabdetach.js index a860362f1f..3cbdde50fc 100644 --- a/browser/base/content/test/performance/browser_tabdetach.js +++ b/browser/base/content/test/performance/browser_tabdetach.js @@ -59,7 +59,7 @@ add_task(async function test_detach_not_overflowed() { expectedReflows: EXPECTED_REFLOWS, // we are opening a whole new window, so there's no point in tracking // rects being painted - frames: { filter: rects => [] }, + frames: { filter: () => [] }, } ); @@ -87,7 +87,7 @@ add_task(async function test_detach_overflowed() { expectedReflows: EXPECTED_REFLOWS, // we are opening a whole new window, so there's no point in tracking // rects being painted - frames: { filter: rects => [] }, + frames: { filter: () => [] }, } ); diff --git a/browser/base/content/test/performance/browser_tabopen.js b/browser/base/content/test/performance/browser_tabopen.js index 2457812cb7..b7eabf4844 100644 --- a/browser/base/content/test/performance/browser_tabopen.js +++ b/browser/base/content/test/performance/browser_tabopen.js @@ -144,7 +144,7 @@ add_task(async function () { await withPerfObserver( async function () { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); - BrowserOpenTab(); + BrowserCommands.openTab(); await BrowserTestUtils.waitForEvent( gBrowser.selectedTab, "TabAnimationEnd" diff --git a/browser/base/content/test/performance/browser_tabopen_squeeze.js b/browser/base/content/test/performance/browser_tabopen_squeeze.js index f92bdc2ea4..dd73f66030 100644 --- a/browser/base/content/test/performance/browser_tabopen_squeeze.js +++ b/browser/base/content/test/performance/browser_tabopen_squeeze.js @@ -52,7 +52,7 @@ add_task(async function () { await withPerfObserver( async function () { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); - BrowserOpenTab(); + BrowserCommands.openTab(); await BrowserTestUtils.waitForEvent( gBrowser.selectedTab, "TabAnimationEnd" diff --git a/browser/base/content/test/performance/browser_tabstrip_overflow_underflow.js b/browser/base/content/test/performance/browser_tabstrip_overflow_underflow.js index 1fd33ed836..50d108c062 100644 --- a/browser/base/content/test/performance/browser_tabstrip_overflow_underflow.js +++ b/browser/base/content/test/performance/browser_tabstrip_overflow_underflow.js @@ -90,7 +90,7 @@ add_task(async function () { await withPerfObserver( async function () { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); - BrowserOpenTab(); + BrowserCommands.openTab(); await BrowserTestUtils.waitForEvent( gBrowser.selectedTab, "TabAnimationEnd" @@ -115,7 +115,7 @@ add_task(async function () { await withPerfObserver( async function () { let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone"); - BrowserOpenTab(); + BrowserCommands.openTab(); await switchDone; await TestUtils.waitForCondition(() => { return gBrowser.tabContainer.arrowScrollbox.hasAttribute( diff --git a/browser/base/content/test/performance/browser_tabswitch.js b/browser/base/content/test/performance/browser_tabswitch.js index bbbbac3a21..ba29efa662 100644 --- a/browser/base/content/test/performance/browser_tabswitch.js +++ b/browser/base/content/test/performance/browser_tabswitch.js @@ -59,6 +59,14 @@ add_task(async function () { getComputedStyle(gBrowser.selectedTab).paddingInlineStart ); let minTabWidth = firstTabRect.width - 2 * tabPaddingStart; + if (AppConstants.platform == "macosx") { + // On macOS, after bug 1886729, gecko screenshots like the ones for this + // test can't screenshot the native titlebar. That, plus the fact that + // there's no border or shadow (see bug 1702653) means that we only end up + // with the tab text color changing, which is smaller than the tab + // background size. + minTabWidth = 0; + } let maxTabWidth = firstTabRect.width; let inRange = (val, min, max) => min <= val && val <= max; @@ -84,11 +92,7 @@ add_task(async function () { // The tab selection changes between 2 adjacent tabs, so we expect // both to change color at once: this should be a single rect of the // width of 2 tabs. - inRange( - r.w, - minTabWidth - 1, // -1 for the border on Win7 - maxTabWidth * 2 - ) + inRange(r.w, minTabWidth, maxTabWidth * 2) ) ) ), diff --git a/browser/base/content/test/performance/browser_windowclose.js b/browser/base/content/test/performance/browser_windowclose.js index 7d11779acc..11fa669be0 100644 --- a/browser/base/content/test/performance/browser_windowclose.js +++ b/browser/base/content/test/performance/browser_windowclose.js @@ -53,7 +53,7 @@ add_task(async function () { { expectedReflows: EXPECTED_REFLOWS, frames: { - filter(rects, frame, previousFrame) { + filter(rects, frame) { // Ignore the focus-out animation. if (isLikelyFocusChange(rects, frame)) { return []; diff --git a/browser/base/content/test/performance/browser_windowopen.js b/browser/base/content/test/performance/browser_windowopen.js index 02c6172948..b258cb67f5 100644 --- a/browser/base/content/test/performance/browser_windowopen.js +++ b/browser/base/content/test/performance/browser_windowopen.js @@ -44,7 +44,7 @@ add_task(async function () { let expectations = { expectedReflows: EXPECTED_REFLOWS, frames: { - filter(rects, frame, previousFrame) { + filter(rects, frame) { // The first screenshot we get in OSX / Windows shows an unfocused browser // window for some reason. See bug 1445161. if (!alreadyFocused && isLikelyFocusChange(rects, frame)) { diff --git a/browser/base/content/test/performance/head.js b/browser/base/content/test/performance/head.js index 29722e6bbe..42f7ae95fc 100644 --- a/browser/base/content/test/performance/head.js +++ b/browser/base/content/test/performance/head.js @@ -42,7 +42,7 @@ async function recordReflows(testPromise, win = window) { let reflows = []; let observer = { - reflow(start, end) { + reflow() { // Gather information about the current code path. reflows.push(new Error().stack); @@ -50,7 +50,7 @@ async function recordReflows(testPromise, win = window) { dirtyFrame(win); }, - reflowInterruptible(start, end) { + reflowInterruptible() { // Interruptible reflows are the reflows caused by the refresh // driver ticking. These are fine. }, @@ -99,11 +99,9 @@ async function recordReflows(testPromise, win = window) { * // Sometimes, due to unpredictable timings, the reflow may be hit * // less times. * stack: [ - * "select@chrome://global/content/bindings/textbox.xml", - * "focusAndSelectUrlBar@chrome://browser/content/browser.js", - * "openLinkIn@chrome://browser/content/utilityOverlay.js", - * "openUILinkIn@chrome://browser/content/utilityOverlay.js", - * "BrowserOpenTab@chrome://browser/content/browser.js", + * "somefunction@chrome://somepackage/content/somefile.mjs", + * "otherfunction@chrome://otherpackage/content/otherfile.js", + * "morecode@resource://somewhereelse/SomeModule.sys.mjs", * ], * // We expect this particular reflow to happen up to 2 times. * maxCount: 2, @@ -113,10 +111,9 @@ async function recordReflows(testPromise, win = window) { * // This reflow is caused by lorem ipsum. We expect this reflow * // to only happen once, so we can omit the "maxCount" property. * stack: [ - * "get_scrollPosition@chrome://global/content/bindings/scrollbox.xml", - * "_fillTrailingGap@chrome://browser/content/tabbrowser.xml", - * "_handleNewTab@chrome://browser/content/tabbrowser.xml", - * "onxbltransitionend@chrome://browser/content/tabbrowser.xml", + * "somefunction@chrome://somepackage/content/somefile.mjs", + * "otherfunction@chrome://otherpackage/content/otherfile.js", + * "morecode@resource://somewhereelse/SomeModule.sys.mjs", * ], * } * ] @@ -430,7 +427,7 @@ async function recordFrames(testPromise, win = window) { let frames = []; - let afterPaintListener = event => { + let afterPaintListener = () => { let width, height; canvas.width = width = win.innerWidth; canvas.height = height = win.innerHeight; -- cgit v1.2.3