toolkit/content/tests/widgets/head.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 "use strict";
     3 function waitForCondition(condition, nextTest, errorMsg) {
     4   var tries = 0;
     5   var interval = setInterval(function() {
     6     if (tries >= 30) {
     7       ok(false, errorMsg);
     8       moveOn();
     9     }
    10     var conditionPassed;
    11     try {
    12       conditionPassed = condition();
    13     } catch (e) {
    14       ok(false, e + "\n" + e.stack);
    15       conditionPassed = false;
    16     }
    17     if (conditionPassed) {
    18       moveOn();
    19     }
    20     tries++;
    21   }, 100);
    22   var moveOn = function() { clearInterval(interval); nextTest(); };
    23 }

mercurial