mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-18 05:07:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
63
editor/libeditor/tests/browser_bug527935.js
Normal file
63
editor/libeditor/tests/browser_bug527935.js
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue