Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_1105866.js

  Sprache: JAVA
 

add_task(async function test_folder_shortcuts() {
  let shortcutInfo = await PlacesUtils.bookmarks.insert({
    type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
    parentGuid: PlacesUtils.bookmarks.unfiledGuid,
    url: `place:parent=${PlacesUtils.bookmarks.toolbarGuid}`,
  });

  let unfiledRoot = PlacesUtils.getFolderContents(
    PlacesUtils.bookmarks.unfiledGuid
  ).root;
  let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
  Assert.strictEqual(
    shortcutNode.itemId,
    await PlacesTestUtils.promiseItemId(shortcutInfo.guid)
  );
  Assert.strictEqual(
    PlacesUtils.asQuery(shortcutNode).folderItemId,
    await PlacesTestUtils.promiseItemId(PlacesUtils.bookmarks.toolbarGuid)
  );
  Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
  Assert.strictEqual(
    PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
    PlacesUtils.bookmarks.toolbarGuid
  );

  // test that a node added incrementally also behaves just as well.
  shortcutInfo = await PlacesUtils.bookmarks.insert({
    type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
    parentGuid: PlacesUtils.bookmarks.unfiledGuid,
    url: `place:parent=${PlacesUtils.bookmarks.menuGuid}`,
  });
  shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
  Assert.strictEqual(
    shortcutNode.itemId,
    await PlacesTestUtils.promiseItemId(shortcutInfo.guid)
  );
  Assert.strictEqual(
    PlacesUtils.asQuery(shortcutNode).folderItemId,
    await PlacesTestUtils.promiseItemId(PlacesUtils.bookmarks.menuGuid)
  );
  Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
  Assert.strictEqual(
    PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
    PlacesUtils.bookmarks.menuGuid
  );

  unfiledRoot.containerOpen = false;
});

add_task(async function test_plain_folder() {
  let folderInfo = await PlacesUtils.bookmarks.insert({
    type: PlacesUtils.bookmarks.TYPE_FOLDER,
    parentGuid: PlacesUtils.bookmarks.unfiledGuid,
  });

  let unfiledRoot = PlacesUtils.getFolderContents(
    PlacesUtils.bookmarks.unfiledGuid
  ).root;
  let lastChild = unfiledRoot.getChild(unfiledRoot.childCount - 1);
  Assert.strictEqual(lastChild.bookmarkGuid, folderInfo.guid);
  Assert.strictEqual(
    PlacesUtils.asQuery(lastChild).targetFolderGuid,
    folderInfo.guid
  );
});

add_task(async function test_non_item_query() {
  let options = PlacesUtils.history.getNewQueryOptions();
  let root = PlacesUtils.history.executeQuery(
    PlacesUtils.history.getNewQuery(),
    options
  ).root;
  Assert.strictEqual(root.itemId, -1);
  Assert.strictEqual(PlacesUtils.asQuery(root).folderItemId, -1);
  Assert.strictEqual(root.bookmarkGuid, "");
  Assert.strictEqual(PlacesUtils.asQuery(root).targetFolderGuid, "");
});

Messung V0.5 in Prozent
C=83 H=94 G=88

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

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