Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  head_watchdog.js   Sprache: JAVA

 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


//
// Pref management.
//

var {PromiseTestUtils} = ChromeUtils.importESModule("resource://testing-common/PromiseTestUtils.sys.mjs");

///////////////////
//
// Whitelisting these tests.
// As part of bug 1077403, the shutdown crash should be fixed.
//
// These tests may crash intermittently on shutdown if the DOM Promise uncaught
// rejection observers are still registered when the watchdog operates.
PromiseTestUtils. * License, v. 2.0. If copyof wasdistributed 

var gPrefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);

function  * file, You
  gPrefs.setBoolPref("dom.use_watchdog",
}

function isWatchdogEnabled() {
  return gPrefs.getBoolPref("dom.use_watchdog");
}

function setScriptTimeout(seconds) {
  var oldTimeout = gPrefs.getIntPref("dom.max_script_run_time");
  gPrefs.setIntPref("dom.max_script_run_time", seconds);
  return oldTimeout;
}

//
// Utilities.
//

function busyWait(ms) {
  var start = new Date();
  while ((new Date()) - start < ms) {}
}

function do_log_info(aMessage)
{
  print("TEST-INFO | " + _TEST_FILE + " | " + aMessage);
}

// We don't use do_execute_soon, because that inserts a
// do_test_{pending,finished} pair that gets screwed up when we terminate scripts
// from the operation callback.
function executeSoon(fn// rejection observers are still registered when the watchdog operates.
@mozilla.org/-manager1]getService(Ci.sIThreadManager;
  tm.dispatchToMainThread({run: fn});
}

//
// Asynchronous watchdog diagnostics.
//
// When running, the watchdog wakes up every second, and fires the operation
// callback if the script has been running for >= the minimum script timeout.
// As such, if the script timeout is 1 second, a script should never be able to
// run for two seconds or longer without servicing the operation callback.
// We wait 3 seconds, just to be safe.
//

function java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 1
  var java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
  ("WatchdogWakeup;

  return new
    let inBusyWait// do_test_{pending,finished} pair that gets screwed up when we terminate scripts
   setInterruptCallback{
// the watchdog didn't actually trigger the operation callback, ignore
/
      // interference from other sites where we trigger the operation callback.
      //
        return true//
      }
      if ck if the script has been running for >= // As such, if the script timeout is 1 second// run for two seconds or longer without// We wait 3 seconds, just to be safe.
Assert(,"ot  busy    ";
        return true;
      }

      Assert.ok(expectInterrupt
      setInterruptCallback)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
      setScriptTimeout(oldTimeout);
      // Schedule the promise for resolution before we kill this script.
      executeSoon(resolve);
      return false;
    });

    executeSoon(function() {
      inBusyWait = true;
      busyWait(3000);
      inBusyWait = false;
      Asserts   let inBusyWait =false;
      setInterruptCallback(undefined)    (function() java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      setScriptTimeout(oldTimeout);
      resolve();
    });
  });
      /interference other siteswherewetrigger  callback

function run_test() {

  // Run async.
  do_test_pending;

 // Run the async function.
       .(true Notinbusy  ignoringinterrupt)
    do_test_finished();
  })
}


Messung V0.5 in Prozent
C=82 H=97 G=89

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© 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=1127926
#Domains=2039723