diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /toolkit/components/satchel/test/test_popup_direction.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/satchel/test/test_popup_direction.html')
-rw-r--r-- | toolkit/components/satchel/test/test_popup_direction.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/toolkit/components/satchel/test/test_popup_direction.html b/toolkit/components/satchel/test/test_popup_direction.html new file mode 100644 index 000000000..02e044bbd --- /dev/null +++ b/toolkit/components/satchel/test/test_popup_direction.html @@ -0,0 +1,61 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for Popup Direction</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script> + <script type="text/javascript" src="satchel_common.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +Test for Popup Direction +<p id="display"></p> + +<!-- we presumably can't hide the content for this test. --> +<div id="content"> + <!-- normal, basic form --> + <form id="form1" onsubmit="return false;"> + <input type="text" name="field1"> + <button type="submit">Submit</button> + </form> +</div> + +<pre id="test"> +<script class="testbody" type="text/javascript"> + +var resolvePopupShownListener; +registerPopupShownListener(() => resolvePopupShownListener()); + +function waitForNextPopup() { + return new Promise(resolve => { resolvePopupShownListener = resolve; }); +} + +add_task(function* test_popup_direction() { + var input = $_(1, "field1"); + + yield new Promise(resolve => updateFormHistory([ + { op : "remove" }, + { op : "add", fieldname : "field1", value : "value1" }, + { op : "add", fieldname : "field1", value : "value2" }, + ], resolve)); + + for (let direction of ["ltr", "rtl"]) { + document.getElementById("content").style.direction = direction; + + let popupShown = waitForNextPopup(); + input.focus(); + doKey("down"); + yield popupShown; + + let popupState = yield new Promise(resolve => getPopupState(resolve)); + is(popupState.direction, direction, "Direction should match."); + + // Close the popup. + input.blur(); + } +}); + +</script> +</pre> +</body> +</html> |