Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_dom_nodes_highlight.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */


"use strict";

const TEST_PAGE_URL = URL_ROOT + "page_dom_nodes.html";

/**
 * Checks that hovering nodes highlights them in the content page
 */

add_task(async function () {
  info("Test DOM panel node highlight started");

  const { panel, tab } = await addTestTab(TEST_PAGE_URL);
  const toolbox = gDevTools.getToolboxForTab(tab);
  const highlighter = toolbox.getHighlighter();

  const tests = [
    {
      expected: "h1",
      getNode: async () => {
        return getRowByIndex(panel, 0).querySelector(".objectBox-node");
      },
    },
    {
      expected: "h2",
      getNode: async () => {
        info("Expand specified row and wait till children are displayed");
        await expandRow(panel, "B");
        return getRowByIndex(panel, 1).querySelector(".objectBox-node");
      },
    },
  ];

  for (const test of tests) {
    info(`Get the NodeFront for ${test.expected}`);
    const node = await test.getNode();

    info("Highlight the node by moving the cursor on it");
    const onHighlighterShown = highlighter.waitForHighlighterShown();
    EventUtils.synthesizeMouseAtCenter(
      node,
      {
        type: "mouseover",
      },
      node.ownerDocument.defaultView
    );
    const { nodeFront } = await onHighlighterShown;
    is(
      nodeFront.displayName,
      test.expected,
      "The correct node was highlighted"
    );

    info("Unhighlight the node by moving the cursor away from it");
    const onHighlighterHidden = highlighter.waitForHighlighterHidden();
    const btn = toolbox.doc.querySelector("#toolbox-meatball-menu-button");
    EventUtils.synthesizeMouseAtCenter(
      btn,
      {
        type: "mouseover",
      },
      btn.ownerDocument.defaultView
    );

    const { nodeFront: unhighlightedNode } = await onHighlighterHidden;
    is(
      unhighlightedNode.displayName,
      test.expected,
      "The node was unhighlighted"
    );
  }
});

Messung V0.5 in Prozent
C=96 H=97 G=96

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002