Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/netwerk/test/browser/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  browser_test_offline_tab.js   Sprache: JAVA

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


"use strict";

add_task(async function test_set_tab_offline() {
  await BrowserTestUtils.withNewTab("https://example.com", async browser => {
    // Set the tab to offline
    gBrowser.selectedBrowser.browsingContext.forceOffline = true;

    await SpecialPowers.spawn(browser, [], async () => {
      try {
        await content.fetch("https://example.com/empty.html");
        ok(false"Should not load since tab is offline");
      } catch (err) {
        is(err.name, "TypeError""Should fail since tab is offline");
      }
    });
  });
});

add_task(async function test_set_tab_online() {
  await BrowserTestUtils.withNewTab("https://example.com", async browser => {
    // Set the tab to online
    gBrowser.selectedBrowser.browsingContext.forceOffline = false;

    await SpecialPowers.spawn(browser, [], async () => {
      try {
        await content.fetch("https://example.com/empty.html");
        ok(true"Should load since tab is online");
      } catch (err) {
        ok(false"Should not fail since tab is online");
      }
    });
  });
});

Messung V0.5
C=89 H=89 G=88

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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