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


Quelle  test_crash_with_content_policy.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/layout/style/test/test_crash_with_content_policy.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Crashtests for style system with content policy</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
</head>
<body>
<iframe id="iframe"></iframe>
<script>
const TESTS = [
  "file_bug1381233.html",
];

const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;

var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}");
var policyName = "@mozilla.org/testpolicy;1";
var policy = {
  // nsISupports implementation
  QueryInterface: function(iid) {

    iid = SpecialPowers.wrap(iid);
    if (iid.equals(Ci.nsISupports) ||
        iid.equals(Ci.nsIFactory) ||
        iid.equals(Ci.nsIContentPolicy))
      return this;

    throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
  },

  // nsIFactory implementation
  createInstance: function(outer, iid) {
    return this.QueryInterface(iid);
  },

  // nsIContentPolicy implementation
  shouldLoad: function(contentLocation, loadInfo) {
    info(`shouldLoad is invoked for ${SpecialPowers.wrap(contentLocation).spec}`);
    return Ci.nsIContentPolicy.ACCEPT;
  },
  shouldProcess: function(contentLocation, loadInfo) {
    return Ci.nsIContentPolicy.ACCEPT;
  }
}
policy = SpecialPowers.wrapCallbackObject(policy);

// Register content policy
var componentManager = SpecialPowers.wrap(SpecialPowers.Components).manager
                                    .QueryInterface(Ci.nsIComponentRegistrar);
componentManager.registerFactory(policyID, "Test content policy", policyName, policy);
var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
categoryManager.addCategoryEntry("content-policy", policyName, policyName, false, true);


SimpleTest.waitForExplicitFinish();

async function runTests() {
  let iframe = document.getElementById("iframe");
  for (let test of TESTS) {
    iframe.src = test;
    await new Promise(resolve => {
      iframe.onload = resolve;
    });
    ok(true, `${test} doesn't crash`);
  }
  categoryManager.deleteCategoryEntry("content-policy", policyName, false);
  componentManager.unregisterFactory(policyID, policy);
  SimpleTest.finish();
}
runTests();
</script>
</body>
</html>

Messung V0.5
C=95 H=94 G=94

¤ Dauer der Verarbeitung: 0.26 Sekunden  (vorverarbeitet)  ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge