summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/chrome/test_dialogfocus.xul
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-25 15:07:00 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:55:19 +0200
commiteb70e6e3d0bff11c25f14b1196025791bf2308fb (patch)
tree5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/content/tests/chrome/test_dialogfocus.xul
parent32ead795290b3399d56b4708fc75b77d296f6a1a (diff)
downloadUXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz
UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/content/tests/chrome/test_dialogfocus.xul')
-rw-r--r--toolkit/content/tests/chrome/test_dialogfocus.xul102
1 files changed, 0 insertions, 102 deletions
diff --git a/toolkit/content/tests/chrome/test_dialogfocus.xul b/toolkit/content/tests/chrome/test_dialogfocus.xul
deleted file mode 100644
index 80474e2b9..000000000
--- a/toolkit/content/tests/chrome/test_dialogfocus.xul
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<button id="test" label="Test"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestCompleteLog();
-
-var expected = [ "one", "_extra2", "tab", "one", "tabbutton2", "tabbutton", "two", "textbox-yes", "one" ];
-// non-Mac will always focus the default button if any of the dialog buttons
-// would be focused
-if (navigator.platform.indexOf("Mac") == -1)
- expected[1] = "_accept";
-
-var step = 0;
-var fullKeyboardAccess = false;
-
-function startTest()
-{
- var testButton = document.getElementById("test");
- synthesizeKey("VK_TAB", { });
- fullKeyboardAccess = (document.activeElement == testButton);
- info("We " + (fullKeyboardAccess ? "have" : "don't have") + " full keyboard access");
- runTest();
-}
-
-function runTest()
-{
- step++;
- info("runTest(), step = " + step + ", expected = " + expected[step - 1]);
- if (step > expected.length || (!fullKeyboardAccess && step == 2)) {
- info("finishing");
- SimpleTest.finish();
- return;
- }
-
- var expectedFocus = expected[step - 1];
- var win = window.openDialog("dialog_dialogfocus.xul", "_new", "chrome,dialog", step);
-
- function checkDialogFocus(event)
- {
- info("checkDialogFocus()");
- // if full keyboard access is not on, just skip the tests
- var match = false;
- if (fullKeyboardAccess) {
- if (!(event.target instanceof Element)) {
- info("target not an Element");
- return;
- }
-
- if (expectedFocus == "textbox-yes")
- match = (win.document.activeElement == win.document.getElementById(expectedFocus).inputField);
- else if (expectedFocus[0] == "_")
- match = (win.document.activeElement.dlgType == expectedFocus.substring(1));
- else
- match = (win.document.activeElement.id == expectedFocus);
- info("match = " + match);
- if (!match)
- return;
- }
- else {
- match = (win.document.activeElement == win.document.documentElement);
- info("match = " + match);
- }
-
- win.removeEventListener("focus", checkDialogFocus, true);
- ok(match, "focus step " + step);
-
- win.close();
- SimpleTest.waitForFocus(runTest, window);
- }
-
- win.addEventListener("focus", checkDialogFocus, true);
-}
-
-SimpleTest.waitForFocus(startTest, window);
-
-]]>
-
-</script>
-
-</window>