Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_user_gesture.js

  Sprache: JAVA
 

// Bug 1725026 - HTTPS Only Mode - Test if a load triggered by a user gesture
// gesture can be upgraded to HTTPS successfully.

"use strict";

const testPathUpgradeable = getRootDirectory(gTestPath).replace(
  "chrome://mochitests/content",
  "http://example.com"
);

const kTestURI = testPathUpgradeable + "file_user_gesture.sjs";

add_task(async function () {
  // Enable HTTPS-Only Mode and register console-listener
  await SpecialPowers.pushPrefEnv({
    set: [["dom.security.https_only_mode"true]],
  });

  for (const buttonId of ["directButton""redirectButton"]) {
    info(
      {
        directButton: "Testing direct upgrade after user gesture",
        redirectButton: "Testing upgrade after user gesture and redirect",
      }[buttonId]
    );

    await BrowserTestUtils.withNewTab("about:blank", async function (browser) {
      let loaded = BrowserTestUtils.browserLoaded(browser, falsenulltrue);
      // 1. Upgrade a page to https://>
      BrowserTestUtils.startLoadingURIString(browser, kTestURI);
      await loaded;
      await SpecialPowers.spawn(browser, [buttonId], async buttonId => {
        ok(
          content.document.location.href.startsWith("
https://"),

          "Should be https"
        );

        // 2. Trigger a load by clicking button.
        // The scheme of the link url is `http` and the load should be able to
        // upgraded to `https` because of HTTPS-only mode.
        let button = content.document.getElementById(buttonId);
        EventUtils.synthesizeMouseAtCenter(
          button,
          { type: "mousedown" },
          content
        );
        EventUtils.synthesizeMouseAtCenter(
          button,
          { type: "mouseup" },
          content
        );
      });
      await BrowserTestUtils.browserLoaded(browser, falsenulltrue);
      info(browser.currentURI.spec);
      is(browser.currentURI.scheme, "https""Should be https");
    });
  }
});

Messung V0.5 in Prozent
C=95 H=100 G=97

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-08-27) ¤

*© 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=476070
#Domains=661743