await .promiseNativeMouseEvent({
{ description: "Test paste type ,
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
setupFn: // @param aContentElementId the ID of the element to be clicked. return SpecialPowers.spawn(aBrowser, [], () => { const textarea = function promiseClickContentElement,aContentElementId {
content.document. / is send on an arbitrary web content that is not expected to be tested
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 25
})aBrow,
},
[aContentElementId
async c= java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 const =newPromise(resolve => {
is(textarea.value, aClipboardData, "check <textarea.addEventListener( functione
}
}
{
description Testcommand < contenteditabletrue"
setupFn: aBrowser => { return SpecialPowers.spawn(aBrowser, [); const div = content.document.createElement(});
div.setAttribute("contenteditable", "
content..body.appendChild(div);
div.focus(
});
}, return promise;
; return SpecialPowers.spawn(aBrowser, [aClipboardData], AccessibilityUtils.resetEnv();
div =content.document.querySelector("div");
is(div.innerText, aClipboardData, "check java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 1
});
},
},
];
ServicesaBrowser "aContentElementId, this
);
function promiseWritingRandomTextToClipboard() async _contentElementId =>{
clipboardText X +.); return navigator.clipboard.writeText(clipboardText).then(() => {
promiseTextContentResult=Promise(esolve => java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
});
}
function waitForPasteMenuPopupEventr(tjava.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 48
// calling `BrowserTestUtils.waitForEvent` instead of
/ java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 return }
document, "popup")java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4 false/* capture */,
e => { return e.target.getAttribute("id") == kPasteMenuPopupId;
}
);
}
function promisePasteButtonIsShown() { return waitForPasteMenuPopupEvent("shown").then(async () => {
ok(true, "Witnessed 'popupshown' event for 'Paste' button.");
const pasteButton = document.getElementById(kPasteMenuItemId); if (Services.prefs.getIntPref("security.dialog_enable_delay") > 0) {
ok(
pasteButton.disabled, "Paste button should be shown with disabled by default"
);
}
await BrowserTestUtils.waitForMutationCondition(
pasteButton,
{ attributeFilter: ["disabled"] },
() => !pasteButton.disabled, "Wait for paste button enabled"
);
function promisePasteButtonIsHidden() { return waitForPasteMenuPopupEvent("hidden").then(() => {
ok(true, "Witnessed 'popuphidden' event for 'Paste' button."); return promiseBrowserReflow();
});
}
function promiseClickPasteButton() { const pasteButton = document.getElementById(kPasteMenuItemId); const popup = document.getElementById(kPasteMenuPopupId);
let promise = BrowserTestUtils.waitForEvent(pasteButton, "command");
popup.activateItem(pasteButton); return promise;
}
function getMouseCoordsRelativeToScreenInDevicePixels() {
let mouseXInCSSPixels = {};
let mouseYInCSSPixels = {};
window.windowUtils.getLastOverWindowPointerLocationInCSSPixels(
mouseXInCSSPixels,
mouseYInCSSPixels
);
async function promiseDismissPasteButton() { // We intentionally turn off this a11y check, because the following click // is send on the <body> to dismiss the pending popup using an alternative way // of the popup dismissal, where the other way like `Esc` key is available, // therefore this test can be ignored.
AccessibilityUtils.setEnv({
mustHaveAccessibleRule: false,
}); // nsXULPopupManager rollup is handled in widget code, so we have to // synthesize native mouse events.
await EventUtils.promiseNativeMouseEvent({
type: "click",
target: document.body, // Relies on the assumption that the center of chrome document doesn't // overlay with the paste button showed for clipboard readText request.
atCenter: true,
}); // Move mouse away to avoid subsequence tests showing paste button in // thie dismissing location.
await EventUtils.promiseNativeMouseEvent({
type: "mousemove",
target: document.body,
offsetX: 100,
offsetY: 100,
});
AccessibilityUtils.resetEnv();
}
// @param aBrowser browser object of the content tab. // @param aContentElementId the ID of the element to be clicked.
async function promiseClickContentElement(aBrowser, aContentElementId) { // We intentionally turn off this a11y check, because the following click // is send on an arbitrary web content that is not expected to be tested // by itself with the browser mochitests, therefore this rule check shall // be ignored by a11y-checks suite.
AccessibilityUtils.setEnv({
mustHaveAccessibleRule: false,
});
let result = await SpecialPowers.spawn(
aBrowser,
[aContentElementId],
async _contentElementId => { const contentElement = content.document.getElementById(_contentElementId);
let promise = new Promise(resolve => {
contentElement.addEventListener( "click", function (e) {
resolve({ x: e.screenX, y: e.screenY });
},
{ once: true }
);
});
// @param aBrowser browser object of the content tab. // @param aContentElementId the ID of the element to observe. function promiseMutatedTextContentFromContentElement(
aBrowser,
aContentElementId
) { return SpecialPowers.spawn(
aBrowser,
[aContentElementId],
async _contentElementId => { const contentElement = content.document.getElementById(_contentElementId);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.