From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- toolkit/content/tests/chrome/chrome.toml | 1 - .../content/tests/chrome/file_editor_with_autocomplete.js | 4 ++++ .../test_autocomplete_with_composition_on_input.html | 2 -- .../chrome/test_editor_for_input_with_autocomplete.html | 2 -- toolkit/content/tests/chrome/window_largemenu.xhtml | 15 ++++++++++++--- 5 files changed, 16 insertions(+), 8 deletions(-) (limited to 'toolkit/content/tests/chrome') diff --git a/toolkit/content/tests/chrome/chrome.toml b/toolkit/content/tests/chrome/chrome.toml index 986822ac48..e037f45ecf 100644 --- a/toolkit/content/tests/chrome/chrome.toml +++ b/toolkit/content/tests/chrome/chrome.toml @@ -51,7 +51,6 @@ support-files = [ ] prefs = [ "gfx.font_rendering.fallback.async=false", - "widget.non-native-theme.enabled=false", ] ["test_about_networking.html"] diff --git a/toolkit/content/tests/chrome/file_editor_with_autocomplete.js b/toolkit/content/tests/chrome/file_editor_with_autocomplete.js index acf2c9e9df..0068440785 100644 --- a/toolkit/content/tests/chrome/file_editor_with_autocomplete.js +++ b/toolkit/content/tests/chrome/file_editor_with_autocomplete.js @@ -84,6 +84,10 @@ nsDoTestsForEditorWithAutoComplete.prototype = { Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH ); }); + if (test.popup) { + await waitForCondition(() => this._controller.input.popupOpen); + } + this._target.removeEventListener("beforeinput", onBeforeInput); this._target.removeEventListener("input", onInput); this._checkResult(test, beforeInputEvents, inputEvents); diff --git a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html index fbcd44e830..fd484a93d1 100644 --- a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html +++ b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html @@ -27,7 +27,6 @@ function runTests() { .QueryInterface(Ci.nsIAutoCompleteInput); var originalFormFillTimeout = formFillController.timeout; - SpecialPowers.attachFormFillControllerTo(window); var target = document.getElementById("input"); // Register a word to the form history. @@ -53,7 +52,6 @@ function runTests() { function() { return target.value; }, function() { formFillController.timeout = originalFormFillTimeout; - SpecialPowers.detachFormFillControllerFrom(window); SimpleTest.finish(); }); }); diff --git a/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html b/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html index 91f0f159b4..f2786d47be 100644 --- a/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html +++ b/toolkit/content/tests/chrome/test_editor_for_input_with_autocomplete.html @@ -51,7 +51,6 @@ async function runTests() { .QueryInterface(Ci.nsIAutoCompleteInput); var originalFormFillTimeout = formFillController.timeout; - SpecialPowers.attachFormFillControllerTo(window); var target = document.getElementById("input"); // Register a word to the form history. @@ -71,7 +70,6 @@ async function runTests() { await tests2.run(); formFillController.timeout = originalFormFillTimeout; - SpecialPowers.detachFormFillControllerFrom(window); SimpleTest.finish(); } diff --git a/toolkit/content/tests/chrome/window_largemenu.xhtml b/toolkit/content/tests/chrome/window_largemenu.xhtml index 8e6b6718b4..413ab248bc 100644 --- a/toolkit/content/tests/chrome/window_largemenu.xhtml +++ b/toolkit/content/tests/chrome/window_largemenu.xhtml @@ -336,14 +336,18 @@ function testPopupMovement() var marginTop = parseFloat(getComputedStyle(popup).marginTop); var panelIsTop = SpecialPowers.getBoolPref("ui.panel.default_level_parent"); - var overlapOSChrome = !platformIsMac() && (!isPanelTest || panelIsTop); + var overlapOSChrome = canOverlapOSChrome() && (!isPanelTest || panelIsTop); popup.moveTo(1, 1); [screenX, screenY] = getScreenXY(popup); var expectedx = 1, expectedy = 1; if (!overlapOSChrome) { - if (screen.availLeft >= 1) expectedx = screen.availLeft; - if (screen.availTop >= 1) expectedy = screen.availTop; + if (screen.availLeft >= 1) { + expectedx = screen.availLeft + marginLeft; + } + if (screen.availTop >= 1) { + expectedy = screen.availTop + marginTop; + } } is(screenX, expectedx, gTests[gTestIndex] + " (1, 1) x"); is(screenY, expectedy, gTests[gTestIndex] + " (1, 1) y"); @@ -398,6 +402,11 @@ function platformIsMac() return navigator.platform.indexOf("Mac") > -1; } +function canOverlapOSChrome() +{ + return navigator.platform.startsWith("Win"); +} + window.arguments[0].SimpleTest.waitForFocus(runTests, window); ]]> -- cgit v1.2.3