Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
a2d1b74
Bug 2014278 - Put attribute_references behind option to prevent alloc…
dcrescalante Feb 4, 2026
73c24a0
Bug 2012393 - Add relay feature into BaseBrowserFragment r=android-re…
mavduevskiy Feb 4, 2026
9870882
Bug 2014318 - Record urlbar pref telemetry in the metrics ping in add…
0c0w3 Feb 4, 2026
317eee7
Bug 2014296 - Fix telemetry for the `quicksuggest.online.available` p…
0c0w3 Feb 4, 2026
491c71f
Bug 2014249: Add try.noartifact mach option to skip autodetection of …
moztcampbell Feb 4, 2026
b52b81e
Bug 2013803 - Part 1: Add tests for './mach android-test'. r=ahochheiden
moztcampbell Feb 4, 2026
10ed4e6
Bug 2013803 - Part 2: Use 'app' path for './mach android-test'. r=aho…
moztcampbell Feb 4, 2026
e09aec1
Bug 2013803 - Part 3: Add geckoview support to './mach android-test'.…
moztcampbell Feb 4, 2026
7b08db2
Bug 2013803 - Part 4: Add --gradle-variant to './mach android-test'. …
moztcampbell Feb 4, 2026
859cefb
Bug 2013803 - Part 5: Add instrumented test support to './mach androi…
moztcampbell Feb 4, 2026
1529ee7
Bug 1990334 - fxa web channel supports better management of oauth flo…
mhammond Feb 4, 2026
c08bd10
Bug 2008613: SendBeacon maximum size fixed to limit at 64K r=dom-core…
jesup Feb 4, 2026
cda7cdf
Bug 2012568: return TypeError for sendBeacon when used with ReadableS…
jesup Feb 4, 2026
b3c3b45
Bug 2009118 - Custom Homepage Settings: show a reorderable, deletable…
nina-py Feb 4, 2026
3e8b9fe
Bug 2009117 - Custom Homepage Settings: Wire up a form to add a custo…
nina-py Feb 4, 2026
092d6f8
Bug 2014329. Make animated avif related prefs only mirrored on startu…
tnikkel Feb 4, 2026
06c37cd
Revert "Bug 2012568: return TypeError for sendBeacon when used with R…
Feb 4, 2026
88f11a1
Revert "Bug 2008613: SendBeacon maximum size fixed to limit at 64K r=…
Feb 4, 2026
135f1f4
Bug 1977924 - Part 1: Introduce Login.hint to concept-storage r=gmale…
jonalmeida Feb 4, 2026
948b8eb
Bug 1977924 - Part 2: Re-work logins in PromptFeature r=gmalekpour,an…
jonalmeida Feb 4, 2026
198572e
Bug 2013528 - Convert NS_MATHML_DELIMITER_* C macros to constexpr. r=…
fred-wang Feb 4, 2026
050e287
Bug 2013528 - Convert NS_MATHML_OPERATOR_SIZE_INFINITY C macro to con…
fred-wang Feb 4, 2026
5a9b453
No Bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBU…
Feb 4, 2026
fb65a05
No Bug - Bumping Mobile l10n changesets r=release a=l10n-bump DONTBUI…
Feb 4, 2026
0170bdf
Bug 2014037 - Avoid race in starting a Fenix search r=android-reviewe…
Mugurell Feb 4, 2026
6e27b58
Bug 2014042 - Ensure the private search suggestions banner is shown o…
Mugurell Feb 4, 2026
2e5783d
Bug 2003798 - Improve name matching for contextual search. r=daleharvey
dharhar Feb 4, 2026
39b74c6
Bug 2012372 - Sign out from Accounts should take user back to classic…
chloezhouny Feb 4, 2026
3818425
Bug 1681411 - Remove mozglue/misc/AutoProfilerLabel.{h,cpp}. r=profil…
carverdamien Feb 4, 2026
6a35c1f
Bug 2010823 - Switch fetch tasks to a Debian 13 docker image. r=relen…
jcristau Feb 4, 2026
b772d4d
Revert "Bug 2010671: Collect the CSS Colors as seen from the web r=ti…
Feb 4, 2026
108e548
Revert "Bug 2014329. Make animated avif related prefs only mirrored o…
Feb 4, 2026
32cb02d
Bug 2013583 - Mark ICScripts as active when cloning stubs. r=iain
jandem Feb 4, 2026
1988d75
Bug 1767707 - [devtools] Skip browser_dbg-backgroundtask-debugging.js…
juliandescottes Feb 4, 2026
66363a0
Bug 2013964 - Avoid including nsHttpResponseHead.h in other headers r…
valenting Feb 4, 2026
abda316
Bug 2013154 - Rm last MD2 references from Necko code r=necko-reviewer…
tqpcharlie Feb 4, 2026
96ae187
Bug 2002791 - Support for passing mach port receive rights to child p…
gabrielesvelto Feb 4, 2026
6e5ca57
Bug 2002791 - Change how the crash helper IPC channels are handled r=…
gabrielesvelto Feb 4, 2026
fc693c9
Bug 2002791 - Support transfering more than one piece of ancillary da…
gabrielesvelto Feb 4, 2026
1b4153a
Bug 2002791 - Overhaul error-handling in the crash helper r=afranchuk
gabrielesvelto Feb 4, 2026
51f21fd
Bug 2002791 - Check that the first step of the crash helper launch wa…
gabrielesvelto Feb 4, 2026
469c8b7
Bug 2002791 - Switch the crash helper to use Mach IPC instead of Unix…
gabrielesvelto Feb 4, 2026
f0e4e4a
Bug 2014353 - Remove deprecated String.capitalize() usage from ApkSiz…
jonalmeida Feb 4, 2026
1a247e9
Bug 2014329. Make animated avif related prefs only mirrored on startu…
tnikkel Feb 4, 2026
fa1870f
Merge mozilla-central to autoland
Feb 4, 2026
8f4c955
Bug 2013964 - Add missing nsHttpConnectionMgr.h include to cpp files …
valenting Feb 4, 2026
e9e1204
Bug 2014128 [Linux] Add more logging to GIO Service r=emilio
stransky Feb 4, 2026
8fa15c0
Bug 1991910 - Use CPU time instead of wall clock in test_MatchPattern…
zombie Feb 4, 2026
a0e34e4
Bug 2014177 - Update the TestRail links to manual test cases for Brok…
delia-pop Feb 4, 2026
86ff74c
Bug 2013458 - Add 'text-box' pref to additional style tests. r=firefo…
kbhomes Feb 4, 2026
a4a00e7
Revert "Bug 2013964 - Add missing nsHttpConnectionMgr.h include to cp…
Feb 4, 2026
570a433
Bug 2013670 - Filter known exceptions before checking for focus chang…
fqueze Feb 4, 2026
d8d99ed
Bug 2003232 - Expose anchor lookup to DevTools. r=nchevobbe,layout-an…
emilio Feb 4, 2026
9e242b1
Bug 2014120 - Remove some noise from generated properties code. r=jwatt
emilio Feb 4, 2026
3271cb4
Bug 2013887 - Remove nsISelectControlFrame. r=layout-reviewers,jfkthame
emilio Feb 4, 2026
f7da904
Bug 2010733 [Wayland] Set mIsMapped before RequestFrameCallbackLocked…
stransky Feb 4, 2026
07451e2
Revert "Bug 2013458 - Add 'text-box' pref to additional style tests. …
Feb 4, 2026
3c4e0d1
Bug 2013887 - Fix win32 build.
emilio Feb 4, 2026
a49bc84
Bug 2010708 - Created SummarizationFragment in Fenix r=segun
fmasalha Feb 4, 2026
1167cbc
Bug 1994148 - Throw UnsupportedOperationError when screenshot is too …
Sameem-baba Feb 4, 2026
e48f9de
Bug 2011494 - Dont test uri matches on content blocking events. r=dai…
daleharvey Feb 4, 2026
f4027ec
Bug 2014219 - Allow non-local traffic exception for DRM provisioning …
aosmond Feb 4, 2026
d364d66
Bug 2013289 - Null check viewer in nsDocShell::ShouldDoInitialAboutBl…
vinhill Feb 4, 2026
2111018
Bug 2013841: Disallow adding weeks, days, and time units to PlainYear…
anba Feb 4, 2026
2850a52
Bug 2013842: Indicate ISO date 1868-10-23 as start of Meiji era. r=sp…
anba Feb 4, 2026
8abb805
Bug 2013843: Use hardcoded table of reference years for Chinese and D…
anba Feb 4, 2026
a5716c4
Bug 2013844: Pass overflow to AddYearMonthDuration. r=spidermonkey-re…
anba Feb 4, 2026
2a1614f
Bug 2013845 - Part 1: Sync and split CalendarDateUntil code. r=spider…
anba Feb 4, 2026
2f790e3
Bug 2013845 - Part 2: Check date surpasses using the unconstrained ca…
anba Feb 4, 2026
1e6aa84
Bug 2013845 - Part 3: Add ISODateSurpasses and CompareSurpasses funct…
anba Feb 4, 2026
0e89734
Bug 2013845 - Part 4: Constrain using start-of-month in DifferenceNon…
anba Feb 4, 2026
4af0468
Bug 2014120 - Minor shorthand parsing/serialization clean-ups. r=jwatt
emilio Feb 4, 2026
eaee05a
Bug 2014356 - Update android nightly application-services version bum…
updatebot-ci Feb 4, 2026
250eedf
Revert "Bug 2010708 - Created SummarizationFragment in Fenix r=segun"…
Feb 4, 2026
9298746
Merge mozilla-central to autoland
Feb 4, 2026
2767aaf
Bug 2014028 - Persist relay store between the fragment recreation r=a…
mavduevskiy Feb 4, 2026
5a61622
Bug 2008613: SendBeacon maximum size fixed to limit at 64K r=dom-core…
jesup Feb 4, 2026
770ee8d
Bug 2012568: return TypeError for sendBeacon when used with ReadableS…
jesup Feb 4, 2026
47fb487
Bug 2014343: Extend timeout for echo-large-bidirectional-streams wpt …
jesup Feb 4, 2026
ea2322a
Bug 2013944 - fix tab detach from AI window to work correctly, r=ai-f…
gijsk Feb 4, 2026
30b3bad
Bug 1441689 - Remove unused trace methods from the profiler JIT entri…
canova Feb 4, 2026
2af0bdc
Bug 1441689 - Store SharedImmutableScriptData inside IonEntry r=iain
canova Feb 4, 2026
429e1d1
Bug 1441689 - Keep a copy of CallStackFrameInfo directly in ProfiledF…
canova Feb 4, 2026
031036e
Bug 1441689 - Add JitCodeAPI back to PerfSpewer r=denispal
canova Feb 4, 2026
d4f8637
Bug 1441689 - Add some more allocation failure checks inside PerfSpew…
canova Feb 4, 2026
b7dcfff
Bug 1441689 - Explicitly free PerfSpewer heap allocations r=denispal,nbp
canova Feb 4, 2026
d8d84ac
Bug 1441689 - Skip consecutive PerfSpewer profiler source entries wit…
canova Feb 4, 2026
da1d6c8
Bug 1441689 - Add line and column information to the JIT frames r=iai…
canova Feb 4, 2026
be4dc54
Bug 1441689 - Record baseline call sites properly when profiling is e…
canova Feb 4, 2026
0d51366
Bug 1441689 - Include line and column number to the frames inside rea…
canova Feb 4, 2026
8329f90
Bug 1441689 - Add profiler jit-test for JS frame line numbers r=iain
canova Feb 4, 2026
b101461
Bug 2007306 - Ignore mica and accent-color-in-titlebar when in HCM. r…
emilio Feb 4, 2026
7b49d6a
Bug 2014195 - Set defaults for the process type and crash time in the…
afranchuk Feb 4, 2026
79913df
Bug 2014156 - Use HarfBuzz to retrieve font baselines and synthesize …
kbhomes Feb 4, 2026
b658ab4
Revert "Bug 2012568: return TypeError for sendBeacon when used with R…
Feb 4, 2026
b2a8ae8
Bug 1661106 - Make UiCompositorBridgeParent::RecvRequestScreenPixels …
jamienicol Feb 4, 2026
fdc8203
Bug 1661106 - Add ScopedGLHelper for creating EGL Image from Android …
jamienicol Feb 4, 2026
090b532
Bug 1661106 - Capture screen pixels by blitting into HardwareBuffer. …
jamienicol Feb 4, 2026
e1d4ccb
Bug 1661106: apply code formatting via Lando
Feb 4, 2026
f4c6c58
Bug 2014178 - Use the BuildID crash annotation for the `crash.app_bui…
afranchuk Feb 4, 2026
ea17c44
Bug 2014395 - Add incrementalWeakMapMarkingEnabled gcparam r=spidermo…
jonco3 Feb 4, 2026
8cacd2e
Bug 1686272 - use `copy.deepcopy` to generate tests when the `--repea…
danilopedraza Feb 4, 2026
471019c
Bug 2014429 - Update PDF.js to new version 222a24c623d0c4c7023f2c6f0c…
calixteman Feb 4, 2026
5f8adac
Bug 2013573 - Handle CCW nuking under ErrorReportBuilder::init better…
jandem Feb 4, 2026
2844ea5
Bug 2013964 - Avoid including nsHttpResponseHead.h in other headers r…
valenting Feb 4, 2026
9b14e42
Bug 2013964 - Add missing includes to netwerk/ cpp files r=necko-revi…
valenting Feb 4, 2026
28732ff
Bug 2014132 - Swap order of "Tracking Protection" and "Reset Customiz…
Trikolon Feb 4, 2026
faff9b8
Bug 2011449 - Part 1: Make it so that newtab messages don't reappear …
mikeconley Feb 4, 2026
2014c0e
Bug 2011449 - Part 2: Add activation window message component. r=home…
mikeconley Feb 4, 2026
ee8077d
Bug 2011449 - Part 3: Add CSS rule for variant a and b that keep the …
mikeconley Feb 4, 2026
f51b2a5
Bug 2011449 - Part 4: Add documentation for newtab activation window …
mikeconley Feb 4, 2026
81cd862
Revert "Bug 2011449 - Part 4: Add documentation for newtab activation…
Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion browser/base/content/browser-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const { UIState } = ChromeUtils.importESModule(
);

ChromeUtils.defineESModuleGetters(this, {
AIWindow:
"moz-src:///browser/components/aiwindow/ui/modules/AIWindow.sys.mjs",
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
EnsureFxAccountsWebChannel:
"resource://gre/modules/FxAccountsWebChannel.sys.mjs",
Expand Down Expand Up @@ -518,6 +520,7 @@ var gSync = {
"browser/sync.ftl",
"browser/syncedTabs.ftl",
"browser/newtab/asrouter.ftl",
"preview/aiWindow.ftl",
],
true
));
Expand Down Expand Up @@ -2384,9 +2387,13 @@ var gSync = {
deleteLocalData: false,
};

const bodyId = AIWindow.hasActiveAIWindows()
? "fxa-signout-dialog-body-aiwindow"
: "fxa-signout-dialog-body";

let [title, body, button, checkbox] = await document.l10n.formatValues([
{ id: "fxa-signout-dialog-title2" },
{ id: "fxa-signout-dialog-body" },
{ id: bodyId },
{ id: "fxa-signout-dialog2-button" },
{ id: "fxa-signout-dialog2-checkbox" },
]);
Expand Down
6 changes: 2 additions & 4 deletions browser/base/content/browser-trustPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,19 @@ class TrustPanel {

async onContentBlockingEvent(
event,
webProgress,
_webProgress,
_isSimulated,
_previousState
) {
// Only accept contentblocking events for uris that we initialised `updateIdentity`
// with, this can go wrong if trustpanel is enabled mid page load.
if (!this.#enabled || webProgress.browsingContext.currentURI != this.#uri) {
if (!this.#enabled || !this.#uri) {
return;
}

// First update all our internal state based on the allowlist and the
// different blockers:
this.anyDetected = false;
this.anyBlocking = false;
this.#lastEvent = event;

// Check whether the user has added an exception for this site.
Expand All @@ -219,7 +218,6 @@ class TrustPanel {
// the data with the document directly.
blocker.activated = blocker.isBlocking(event);
this.anyDetected = this.anyDetected || blocker.isDetected(event);
this.anyBlocking = this.anyBlocking || blocker.activated;
}

if (this.#popup) {
Expand Down
31 changes: 21 additions & 10 deletions browser/base/content/test/performance/browser_startup_flicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,10 @@ add_task(async function () {
let frame = frames[i],
previousFrame = frames[i - 1];
let rects = compareFrames(frame, previousFrame);
if (!alreadyFocused && isLikelyFocusChange(rects, frame)) {
todo(
false,
"bug 1445161 - the window should be focused at first paint, " +
rects.toSource()
);
continue;
}
alreadyFocused = true;

let expectedRects = [];
let focusRects = [];

rects = rects.filter(rect => {
let width = frame.width;

Expand Down Expand Up @@ -83,14 +76,32 @@ add_task(async function () {
}
}

ok(false, "unexpected changed rect: " + rectText);
if (!alreadyFocused) {
focusRects.push(rect);
}
return true;
});

if (!alreadyFocused && isLikelyFocusChange(focusRects, frame)) {
todo(
false,
"bug 1445161 - the window should be focused at first paint, " +
focusRects.toSource()
);
continue;
}
alreadyFocused = true;

if (!rects.length) {
info("ignoring identical frame");
continue;
}

for (let rect of rects) {
let rectText = `${rect.toSource()}, window width: ${frame.width}`;
ok(false, "unexpected changed rect: " + rectText);
}

await reportFlickerWithAPNG(previousFrame, frame, i, expectedRects);
unexpectedRects += rects.length;
}
Expand Down
1 change: 1 addition & 0 deletions browser/components/BrowserComponents.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ category browser-quit-application-granted resource://gre/modules/UpdateListener.
#endif
category browser-quit-application-granted moz-src:///browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs UrlbarSearchTermsPersistence.uninit
category browser-quit-application-granted moz-src:///browser/components/ipprotection/IPProtectionService.sys.mjs IPProtectionService.uninit
category browser-quit-application-granted moz-src:///browser/components/aiwindow/ui/modules/AIWindow.sys.mjs AIWindow.uninit

category search-service-notification moz-src:///browser/components/search/SearchUIUtils.sys.mjs SearchUIUtils.showSearchServiceNotification

Expand Down
62 changes: 57 additions & 5 deletions browser/components/aiwindow/ui/modules/AIWindow.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ ChromeUtils.defineESModuleGetters(lazy, {
AIWindowMenu:
"moz-src:///browser/components/aiwindow/ui/modules/AIWindowMenu.sys.mjs",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
SearchService: "moz-src:///toolkit/components/search/SearchService.sys.mjs",
SearchUIUtils: "moz-src:///browser/components/search/SearchUIUtils.sys.mjs",
ChatStore:
"moz-src:///browser/components/aiwindow/ui/modules/ChatStore.sys.mjs",
NewTabPagePreloading:
"moz-src:///browser/components/tabbrowser/NewTabPagePreloading.sys.mjs",
ONLOGOUT_NOTIFICATION: "resource://gre/modules/FxAccountsCommon.sys.mjs",
PanelMultiView:
"moz-src:///browser/components/customizableui/PanelMultiView.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
SearchService: "moz-src:///toolkit/components/search/SearchService.sys.mjs",
SearchUIUtils: "moz-src:///browser/components/search/SearchUIUtils.sys.mjs",
MemoriesSchedulers:
"moz-src:///browser/components/aiwindow/models/memories/MemoriesSchedulers.sys.mjs",
});
Expand Down Expand Up @@ -62,6 +63,7 @@ export const AIWindow = {
}

ChromeUtils.defineLazyGetter(AIWindow, "chatStore", () => lazy.ChatStore);
Services.obs.addObserver(this, lazy.ONLOGOUT_NOTIFICATION);
this._initialized = true;

// On startup/restart, if the first window initialized is an
Expand All @@ -71,6 +73,42 @@ export const AIWindow = {
}
},

uninit() {
if (!this._initialized) {
return;
}
Services.obs.removeObserver(this, lazy.ONLOGOUT_NOTIFICATION);
this._initialized = false;
},

observe(_subject, topic) {
if (topic === lazy.ONLOGOUT_NOTIFICATION) {
this._onAccountLogout();
}
},

// Switches all active AI Windows back to classic mode when the user signs out
// of their Firefox Account.
_onAccountLogout() {
for (const win of Services.wm.getEnumerator("navigator:browser")) {
if (!win.closed && this.isAIWindowActive(win)) {
this.toggleAIWindow(win, false);
}
}
},

// Checks if there are any open AI Windows. It's used to determine if certain
// operations (like Account sign-out warnings) need to account for active AI
// Window sessions.
hasActiveAIWindows() {
for (const win of Services.wm.getEnumerator("navigator:browser")) {
if (!win.closed && this.isAIWindowActiveAndEnabled(win)) {
return true;
}
}
return false;
},

_reconcileNewTabPages(win, previousNewTabURL) {
const newTabURI = Services.io.newURI(win.BROWSER_NEW_TAB_URL);
const oldTabURI = Services.io.newURI(previousNewTabURL);
Expand Down Expand Up @@ -194,13 +232,27 @@ export const AIWindow = {
}
aiWindowURI.data = initialURL;
args.appendElement(aiWindowURI);
}

const aiOption = Cc["@mozilla.org/hash-property-bag;1"].createInstance(
let propBag;
try {
propBag = args.length > 1 && args.queryElementAt(1, Ci.nsIPropertyBag2);
} catch (e) {
console.error(
new Error(
"Tried to create AI window but property bag argument is wrong"
),
propBag
);
return args;
}
if (!propBag) {
propBag = Cc["@mozilla.org/hash-property-bag;1"].createInstance(
Ci.nsIWritablePropertyBag2
);
aiOption.setPropertyAsBool("ai-window", aiWindow);
args.appendElement(aiOption);
args.appendElement(propBag);
}
propBag.setPropertyAsBool("ai-window", true);

return args;
},
Expand Down
2 changes: 2 additions & 0 deletions browser/components/aiwindow/ui/test/browser/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ support-files = [
["browser_sidebar_aiwindow.js"]

["browser_smartwindow_init.js"]

["browser_smartwindow_tab_move.js"]
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ add_task(async function test_memories_scheduler_on_init_with_aiwindow() {

testWin.document.documentElement.setAttribute("ai-window", "");

AIWindow._initialized = false;
// Use uninit() to properly clean up observer before re-initializing
AIWindow.uninit();
AIWindow.init(testWin);

Assert.ok(
Expand All @@ -89,7 +90,8 @@ add_task(
private: false,
});

AIWindow._initialized = false;
// Use uninit() to properly clean up observer before re-initializing
AIWindow.uninit();
AIWindow.init(testWin);

Assert.ok(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,29 @@ add_task(async function test_switcher_repositions_on_pref_change() {

await SpecialPowers.flushPrefEnv();
});

// Test that _onAccountLogout switches AI windows to classic mode
add_task(async function test_onAccountLogout_switches_windows() {
const { AIWindow } = ChromeUtils.importESModule(
"moz-src:///browser/components/aiwindow/ui/modules/AIWindow.sys.mjs"
);

await SpecialPowers.pushPrefEnv({
set: [["browser.aiwindow.enabled", true]],
});

document.documentElement.setAttribute("ai-window", "");
Assert.ok(
AIWindow.isAIWindowActive(window),
"Window should start in AI mode"
);

AIWindow._onAccountLogout();

Assert.ok(
!AIWindow.isAIWindowActive(window),
"Window should switch to classic mode after logout"
);

await SpecialPowers.popPrefEnv();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const { TabStateFlusher } = ChromeUtils.importESModule(
"resource:///modules/sessionstore/TabStateFlusher.sys.mjs"
);

// Move a tab to a new window, check the new window is also an AI window.
add_task(async function test() {
let tab1 = await BrowserTestUtils.addTab(gBrowser, "about:blank");
let tab2 = await BrowserTestUtils.addTab(gBrowser, "about:blank");

is(gBrowser.multiSelectedTabsCount, 0, "Zero multiselected tabs");

AIWindow.toggleAIWindow(window, true);
registerCleanupFunction(() => {
AIWindow.toggleAIWindow(window, false);
});
await BrowserTestUtils.switchTab(gBrowser, tab1);
let prevBrowser = tab1.linkedBrowser;

let delayedStartupPromise = BrowserTestUtils.waitForNewWindow();
let newWindow = gBrowser.replaceTabsWithWindow(tab1);
await delayedStartupPromise;

ok(
!prevBrowser.frameLoader,
"the swapped-from browser's frameloader has been destroyed"
);

let gBrowser2 = newWindow.gBrowser;
ok(AIWindow.isAIWindowActive(newWindow), "The new window is an AI window");

is(gBrowser.visibleTabs.length, 2, "Two tabs now in the old window");
is(gBrowser2.visibleTabs.length, 1, "One tab in the new window");

tab1 = gBrowser2.visibleTabs[0];
ok(tab1, "Got a tab1");
await tab1.focus();

await TabStateFlusher.flush(tab1.linkedBrowser);

await BrowserTestUtils.closeWindow(newWindow);
await BrowserTestUtils.removeTab(tab2);
});
Loading
Loading