Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_storage_search.js

  Sprache: JAVA
 

// Tests the filter search box in the storage inspector
"use strict";

add_task(async function () {
  await openTabAndSetupStorage(MAIN_DOMAIN_SECURED + "storage-search.html");

  gUI.tree.expandAll();
  await selectTreeItem(["cookies""https://test1.example.org"]);

  showColumn("expires"false);
  showColumn("host"false);
  showColumn("isHttpOnly"false);
  showColumn("lastAccessed"false);
  showColumn("path"false);

  // Results: 0=hidden, 1=visible
  const testcases = [
    // Test that search isn't case-sensitive
    {
      value: "FoO",
      results: [0011010],
    },
    {
      value: "OR",
      results: [0100010],
    },
    {
      value: "aNImAl",
      results: [0100000],
    },
    // Test numbers
    {
      value: "01",
      results: [1000001],
    },
    {
      value: "2016",
      results: [0000001],
    },
    {
      value: "56789",
      results: [1000000],
    },
    // Test filtering by value
    {
      value: "horse",
      results: [0100000],
    },
    {
      value: "$$$",
      results: [0000100],
    },
    {
      value: "bar",
      results: [0011000],
    },
    // Test input with whitespace
    {
      value: "energy b",
      results: [0010000],
    },
    // Test no input at all
    {
      value: "",
      results: [1111111],
    },
    // Test input that matches nothing
    {
      value: "input that matches nothing",
      results: [0000000],
    },
  ];

  const testcasesAfterHiding = [
    // Test that search isn't case-sensitive
    {
      value: "OR",
      results: [0000010],
    },
    {
      value: "01",
      results: [1000000],
    },
    {
      value: "2016",
      results: [0000000],
    },
    {
      value: "56789",
      results: [0000000],
    },
    // Test filtering by value
    {
      value: "horse",
      results: [0000000],
    },
    {
      value: "$$$",
      results: [0000000],
    },
    {
      value: "bar",
      results: [0000000],
    },
    // Test input with whitespace
    {
      value: "energy b",
      results: [0000000],
    },
  ];

  runTests(testcases);
  showColumn("value"false);
  runTests(testcasesAfterHiding);
});

function runTests(testcases) {
  const $$ = sel => gPanelWindow.document.querySelectorAll(sel);
  const names = $$("#name .table-widget-cell");
  const rows = $$("#value .table-widget-cell");
  for (const testcase of testcases) {
    const { value, results } = testcase;

    info(`Testing input: ${value}`);

    gUI.searchBox.value = value;
    gUI.filterItems();

    for (let i = 0; i < rows.length; i++) {
      info(`Testing row ${i} for "${value}"`);
      info(`key: ${names[i].value}, value: ${rows[i].value}`);
      const state = results[i] ? "visible" : "hidden";
      is(
        rows[i].hasAttribute("hidden"),
        !results[i],
        `Row ${i} should be ${state}`
      );
    }
  }
}

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

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-06) ¤

*© 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

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik