summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/tests/browser_bug527935.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /editor/libeditor/tests/browser_bug527935.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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 'editor/libeditor/tests/browser_bug527935.js')
-rw-r--r--editor/libeditor/tests/browser_bug527935.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/editor/libeditor/tests/browser_bug527935.js b/editor/libeditor/tests/browser_bug527935.js
new file mode 100644
index 000000000..dc6e74d3e
--- /dev/null
+++ b/editor/libeditor/tests/browser_bug527935.js
@@ -0,0 +1,63 @@
+add_task(function*() {
+ yield new Promise(resolve => waitForFocus(resolve, window));
+
+ const kPageURL = "http://example.org/browser/editor/libeditor/tests/bug527935.html";
+ yield BrowserTestUtils.withNewTab({
+ gBrowser,
+ url: kPageURL
+ }, function*(aBrowser) {
+ var popupShown = false;
+ function listener() {
+ popupShown = true;
+ }
+ SpecialPowers.addAutoCompletePopupEventListener(window, "popupshowing", listener);
+
+ yield ContentTask.spawn(aBrowser, {}, function*() {
+ var window = content.window.wrappedJSObject;
+ var document = window.document;
+ var formTarget = document.getElementById("formTarget");
+ var initValue = document.getElementById("initValue");
+
+ window.loadPromise = new Promise(resolve => {
+ formTarget.onload = resolve;
+ });
+
+ initValue.focus();
+ initValue.value = "foo";
+ });
+
+ EventUtils.synthesizeKey("VK_RETURN", {});
+
+ yield ContentTask.spawn(aBrowser, {}, function*() {
+ var window = content.window.wrappedJSObject;
+ var document = window.document;
+
+ yield window.loadPromise;
+
+ var newInput = document.createElement("input");
+ newInput.setAttribute("name", "test");
+ document.body.appendChild(newInput);
+
+ var event = document.createEvent("KeyboardEvent");
+
+ event.initKeyEvent("keypress", true, true, null, false, false,
+ false, false, 0, "f".charCodeAt(0));
+ newInput.value = "";
+ newInput.focus();
+ newInput.dispatchEvent(event);
+ });
+
+ yield new Promise(resolve => hitEventLoop(resolve, 100));
+
+ ok(!popupShown, "Popup must not be opened");
+ SpecialPowers.removeAutoCompletePopupEventListener(window, "popupshowing", listener);
+ });
+});
+
+function hitEventLoop(func, times) {
+ if (times > 0) {
+ setTimeout(hitEventLoop, 0, func, times - 1);
+ } else {
+ setTimeout(func, 0);
+ }
+}