Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_bug1322678.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/html/test/test_bug1322678.html


<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1322678
-->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test for Bug 1322678</title>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script type="text/javascript">

const CUSTOM_TITLE = "Custom Title";

async function openNewWindowForTest() {
  let win = window.open("bug369370-popup.png""bug1322678",
                    "width=400,height=300,scrollbars=no");
  ok(win, "opened child window");

  await new Promise(resolve => {
    win.onload = function() {
      ok(true, "window loaded");
      resolve();
    };
  });

  return win;
}

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});

    let decorationSize = aWin.outerHeight - aWin.innerHeight;
    aWin.resizeTo(800 + 50 + decorationSize, 600 + 50 + decorationSize);
  });

  // 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});

    aWin.resizeTo(400, 300);
  });
}

// eslint-disable-next-line mozilla/no-addtask-setup
add_task(async function setup() {
  await SpecialPowers.pushPrefEnv({"set": [
    ["browser.enable_automatic_image_resizing", 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
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge