diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:55:19 +0200 |
commit | eb70e6e3d0bff11c25f14b1196025791bf2308fb (patch) | |
tree | 5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/satchel/test/test_popup_enter_event.html | |
parent | 32ead795290b3399d56b4708fc75b77d296f6a1a (diff) | |
download | UXP-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/components/satchel/test/test_popup_enter_event.html')
-rw-r--r-- | toolkit/components/satchel/test/test_popup_enter_event.html | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/toolkit/components/satchel/test/test_popup_enter_event.html b/toolkit/components/satchel/test/test_popup_enter_event.html deleted file mode 100644 index 1a7aa8c19..000000000 --- a/toolkit/components/satchel/test/test_popup_enter_event.html +++ /dev/null @@ -1,86 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta charset="utf-8"> - <title>Test for events while the form history popup is open</title> - <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> - <script type="text/javascript" src="satchel_common.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> -</head> -<body> -Form History test: Test for events while the form history popup is open -<p id="display"></p> - -<div id="content"> - <form id="form1"> - <input type="text" name="field1"> - <button type="submit">Submit</button> - </form> -</div> - -<pre id="test"> -<script class="testbody"> -var form = document.getElementById("form1"); -var input = $_(1, "field1"); -var expectedValue = "value1"; - -function setupFormHistory(aCallback) { - updateFormHistory([ - { op : "remove" }, - { op : "add", fieldname : "field1", value : "value1" }, - ], aCallback); -} - -registerPopupShownListener(popupShownListener); - -function handleEnter(evt) { - if (evt.keyCode != KeyEvent.DOM_VK_RETURN) { - return; - } - - info("RETURN received for phase: " + evt.eventPhase); - if (input.value == expectedValue) { - ok(true, "RETURN should be received when the popup is closed"); - is(input.value, expectedValue, "Check input value when enter is pressed the 2nd time"); - info("form should submit with the default handler"); - } else { - ok(false, "RETURN keypress shouldn't have been received when a popup item is selected"); - } -} - -function popupShownListener(evt) { - doKey("down"); - doKey("return"); // select the first entry in the popup - doKey("return"); // try to submit the form with the filled value -} - -function runTest() { - input.addEventListener("keypress", handleEnter, true); - form.addEventListener("submit", evt => { - is(input.value, expectedValue, "Check input value in the submit handler"); - evt.preventDefault(); - SimpleTest.finish(); - }); - - // Focus the input before adjusting.value so that the caret goes to the end - // (since OS X doesn't show the dropdown otherwise). - input.focus(); - input.value = "value" - input.focus(); - doKey("down"); -} - -function startTest() { - setupFormHistory(function() { - runTest(); - }); -} - -window.onload = startTest; - -SimpleTest.waitForExplicitFinish(); -</script> -</pre> -</body> -</html> |