diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /browser/components/migration/tests/browser/browser_dialog_resize.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/migration/tests/browser/browser_dialog_resize.js')
-rw-r--r-- | browser/components/migration/tests/browser/browser_dialog_resize.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/browser/components/migration/tests/browser/browser_dialog_resize.js b/browser/components/migration/tests/browser/browser_dialog_resize.js new file mode 100644 index 0000000000..8fb05faf2c --- /dev/null +++ b/browser/components/migration/tests/browser/browser_dialog_resize.js @@ -0,0 +1,29 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Tests that if the MigrationWizard resizes when opened inside of a + * XUL window, that it causes the containing XUL window to resize + * appropriately. + */ +add_task(async function test_migration_dialog_resize_in_xul_window() { + let windowOpened = BrowserTestUtils.domWindowOpened(); + MigrationUtils.showMigrationWizard(null, {}); + let dialogWin = await windowOpened; + + await BrowserTestUtils.waitForEvent(dialogWin, "MigrationWizard:Ready"); + + let wizard = dialogWin.document.body.querySelector("#wizard"); + let height = wizard.getBoundingClientRect().height; + + let windowResizePromise = BrowserTestUtils.waitForEvent(dialogWin, "resize"); + wizard.style.height = height + 100 + "px"; + await windowResizePromise; + Assert.ok(true, "Migration dialog window resized."); + + let dialogClosed = BrowserTestUtils.domWindowClosed(dialogWin); + dialogWin.close(); + await dialogClosed; +}); |