async function testCustomTitle(aWin, aTitle) {
let doc = aWin.document;
let elements = doc.getElementsByTagName("img");
is(elements.length, 1, "looking for img in ImageDocument");
let img = elements[0];
// Click to zoom in
synthesizeMouse(img, 25, 25, { }, aWin);
is(doc.title, aTitle, "Checking title");
// Click there again to zoom out
synthesizeMouse(img, 25, 25, { }, aWin);
is(doc.title, aTitle, "Checking title");
// Now try resizing the window so the image fits vertically and horizontally.
await new Promise(resolve => {
aWin.addEventListener("resize", function() {
// Give the image document time to respond
SimpleTest.executeSoon(function() {
is(doc.title, aTitle, "Checking title");
resolve();
});
}, {once: true});
// Now try resizing the window so the image no longer fits.
await new Promise(resolve => {
aWin.addEventListener("resize", function() {
// Give the image document time to respond
SimpleTest.executeSoon(function() {
is(doc.title, aTitle, "Checking title");
resolve();
});
}, {once: true});
add_task(async function testUpdateDocumentTitle() {
let win = await openNewWindowForTest();
// Set custom title.
win.document.title = CUSTOM_TITLE;
await testCustomTitle(win, CUSTOM_TITLE);
win.close();
});
add_task(async function testUpdateTitleElement() {
let win = await openNewWindowForTest();
// Set custom title.
let title = win.document.getElementsByTagName("title")[0]; title.text = CUSTOM_TITLE;
await testCustomTitle(win, CUSTOM_TITLE);
win.close();
});
add_task(async function testAppendNewTitleElement() {
let win = await openNewWindowForTest();
// Set custom title.
let doc = win.document;
doc.getElementsByTagName("title")[0].remove();
let title = doc.createElement("title"); title.text = CUSTOM_TITLE;
doc.head.appendChild(title);
await testCustomTitle(win, CUSTOM_TITLE);
win.close();
});
</script>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.26 Sekunden
(vorverarbeitet am 2026-08-24)
¤
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.