summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/chrome
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /dom/tests/mochitest/chrome
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/chrome')
-rw-r--r--dom/tests/mochitest/chrome/child_focus_frame.html2
-rw-r--r--dom/tests/mochitest/chrome/file_bug800817.xhtml11
-rw-r--r--dom/tests/mochitest/chrome/test_bug800817.xhtml10
-rw-r--r--dom/tests/mochitest/chrome/window_focus.xhtml57
4 files changed, 50 insertions, 30 deletions
diff --git a/dom/tests/mochitest/chrome/child_focus_frame.html b/dom/tests/mochitest/chrome/child_focus_frame.html
index d7f0ff63cd..89e9b8aae1 100644
--- a/dom/tests/mochitest/chrome/child_focus_frame.html
+++ b/dom/tests/mochitest/chrome/child_focus_frame.html
@@ -43,8 +43,8 @@
<fieldset style="float: right;">
<legend id="legend">Options</legend>
<input id="t28" type="radio" name="options" value="optionone">One
- <label id="ad" accesskey="d">Label:<input id="t29" type="radio" name="options" value="optiontwo">Two</label>
</fieldset>
+<label id="ad" accesskey="d">Label:<input id="t29" type="radio" name="options2" value="optiontwo">Two</label>
<div id="t30" tabindex="0">abc</div>
<input id="o18" accesskey="u" disabled size="3"/>
<label id="ag" accesskey="g" for="n6">L</label>
diff --git a/dom/tests/mochitest/chrome/file_bug800817.xhtml b/dom/tests/mochitest/chrome/file_bug800817.xhtml
index bcd64b3ca7..ea646a74a1 100644
--- a/dom/tests/mochitest/chrome/file_bug800817.xhtml
+++ b/dom/tests/mochitest/chrome/file_bug800817.xhtml
@@ -30,16 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
var b1 = document.getElementById("b1");
var b2 = document.getElementById("b2");
- var testMozBrowser = window.arguments[0].testMozBrowser;
- if (testMozBrowser) {
- b1.setAttribute("mozbrowser", "true");
- b2.setAttribute("mozbrowser", "true");
- }
-
- if (testMozBrowser)
- window.arguments[0].info("Testing with mozbrowser=true");
- else
- window.arguments[0].info("Testing without mozbrowser");
+ window.arguments[0].info("Testing...");
b1.contentWindow.focus();
window.arguments[0].is(document.activeElement, b1,
diff --git a/dom/tests/mochitest/chrome/test_bug800817.xhtml b/dom/tests/mochitest/chrome/test_bug800817.xhtml
index fefaf2c155..76ea31a2fc 100644
--- a/dom/tests/mochitest/chrome/test_bug800817.xhtml
+++ b/dom/tests/mochitest/chrome/test_bug800817.xhtml
@@ -20,20 +20,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
<![CDATA[
/** Test for Bug 800817 **/
- var testMozBrowser = false;
function runTests() {
- // Run a first round of tests for non-mozbrowser iframes.
window.openDialog("file_bug800817.xhtml", "_blank", "chrome,width=600,height=550,noopener", window);
}
function finishedTests() {
- if (!testMozBrowser) {
- testMozBrowser = true;
- // Run a second round of tests for mozbrowser iframes.
- window.openDialog("file_bug800817.xhtml", "_blank", "chrome,width=600,height=550,noopener", window);
- } else {
- SimpleTest.finish();
- }
+ SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
diff --git a/dom/tests/mochitest/chrome/window_focus.xhtml b/dom/tests/mochitest/chrome/window_focus.xhtml
index e4cfeb6560..a1f9838450 100644
--- a/dom/tests/mochitest/chrome/window_focus.xhtml
+++ b/dom/tests/mochitest/chrome/window_focus.xhtml
@@ -46,6 +46,9 @@ var gChildWindow = null;
var gOldExpectedWindow = null;
var gNewExpectedWindow = null;
+var gCanTabMoveFocusToRootElement =
+ !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element");
+
function is(l, r, n) { window.arguments[0].SimpleTest.is(l,r,n); }
function ok(v, n) { window.arguments[0].SimpleTest.ok(v,n); }
@@ -398,8 +401,18 @@ function startTest()
gLastFocusMethod = fm.FLAG_BYKEY;
if (gPartialTabbing) {
- var partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t13", "t14", "t15",
- "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"];
+ var partialTabList;
+ if (gCanTabMoveFocusToRootElement) {
+ partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t13", "t14", "t15",
+ "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"];
+ } else {
+ // !gCanTabMoveFocusToRootElement
+ // t13 is the <html> element in child_focus_frame.html,
+ // and it's not getting the focus
+ // when gCanTabMoveFocusToRootElement is false.
+ partialTabList = ["t3", "t5", "t9", "t10", "t11", "t12", "t14", "t15",
+ "t16", "t19", "t20", "t21", "t22", "t26", "t27", "t28", "t29", "t30"];
+ }
for (var idx = 0; idx < partialTabList.length; idx++) {
expectFocusShift(pressTab, null, getById(partialTabList[idx]), true, "partial tab key " + partialTabList[idx]);
}
@@ -415,6 +428,13 @@ function startTest()
else {
// TAB key
for (var idx = 1; idx <= kTabbableSteps; idx++) {
+ if (!gCanTabMoveFocusToRootElement) {
+ if (idx == kChildDocumentRootIndex)
+ // t13 is the <html> element in child_focus_frame.html,
+ // and it's not getting the focus
+ // when gCanTabMoveFocusToRootElement is false.
+ continue;
+ }
expectFocusShift(pressTab, null, getById("t" + idx), true, "tab key t" + idx);
}
@@ -427,6 +447,14 @@ function startTest()
// Shift+TAB key
setFocusTo("o5", window);
for (idx = kTabbableSteps; idx > 0; idx--) {
+ if (!gCanTabMoveFocusToRootElement) {
+ if (idx == kChildDocumentRootIndex) {
+ // t13 is the <html> element in child_focus_frame.html,
+ // and it's not getting the focus
+ // when gCanTabMoveFocusToRootElement is false.
+ continue;
+ }
+ }
expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}),
null, getById("t" + idx), true, "shift tab key t" + idx);
}
@@ -1158,29 +1186,38 @@ function framesetWindowLoaded(framesetWindow)
gOldExpectedWindow = getTopWindow(framesetWindow);
gMoveToFocusFrame = true;
- for (var idx = 1; idx <= 8; idx++) {
- gNewExpectedWindow = framesetWindow.frames[(idx - 1) >> 1];
- if (idx % 2)
+ let steps = gCanTabMoveFocusToRootElement ? 8 : 4;
+ for (var idx = 1; idx <= steps; idx++) {
+ let frameIndex = gCanTabMoveFocusToRootElement ? (idx - 1) >> 1 : idx - 1;
+ gNewExpectedWindow = framesetWindow.frames[frameIndex];
+ if (gCanTabMoveFocusToRootElement) {
+ if (idx % 2) {
+ initEvents(gNewExpectedWindow);
+ }
+ } else {
initEvents(gNewExpectedWindow);
+ }
expectFocusShift(() => synthesizeKey("KEY_Tab", {}, framesetWindow),
- gNewExpectedWindow, getById("f" + idx), true, "frameset tab key f" + idx);
+ gNewExpectedWindow, getById("f" + (gCanTabMoveFocusToRootElement ? idx : idx * 2)), true, "frameset tab key f" + idx);
gMoveToFocusFrame = false;
gOldExpectedWindow = gNewExpectedWindow;
}
gNewExpectedWindow = framesetWindow.frames[0];
expectFocusShift(() => synthesizeKey("KEY_Tab", {}, framesetWindow),
- gNewExpectedWindow, getById("f1"), true, "frameset tab key wrap to start");
+ gNewExpectedWindow, gCanTabMoveFocusToRootElement ? getById("f1") : getById("f2"), true, "frameset tab key wrap to start");
gOldExpectedWindow = gNewExpectedWindow;
gNewExpectedWindow = framesetWindow.frames[3];
expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}, framesetWindow),
gNewExpectedWindow, getById("f8"), true, "frameset shift tab key wrap to end");
- for (idx = 7; idx >= 1; idx--) {
+ steps = gCanTabMoveFocusToRootElement ? 7 : 3;
+ for (idx = steps; idx >= 1; idx--) {
gOldExpectedWindow = gNewExpectedWindow;
- gNewExpectedWindow = framesetWindow.frames[(idx - 1) >> 1];
+ let frameIndex = gCanTabMoveFocusToRootElement ? (idx - 1) >> 1 : idx - 1;
+ gNewExpectedWindow = framesetWindow.frames[frameIndex];
expectFocusShift(() => synthesizeKey("KEY_Tab", {shiftKey: true}, framesetWindow),
- gNewExpectedWindow, getById("f" + idx), true, "frameset shift tab key f" + idx);
+ gNewExpectedWindow, getById("f" + (gCanTabMoveFocusToRootElement ? idx : idx * 2)), true, "frameset shift tab key f" + idx);
}
// document shifting