rem:  if (forceCC) { if (window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils) .garbageCollect) { useCCApi = true; } } 
context: function plInit() {  if (running) {    return;  }  running = true;  cycle = 0;  try {    var args = window.arguments[0].wrappedJSObject;    var manifestURI = args.manifest;    var startIndex = 0;    var endIndex = -1;    if (args.startIndex) startIndex = parseInt(args.startIndex);    if (args.endIndex) endIndex = parseInt(args.endIndex);    if (args.numCycles) NUM_CYCLES = parseInt(args.numCycles);    if (args.format) reportFormat = args.format;    if (args.width) winWidth = parseInt(args.width);    if (args.height) winHeight = parseInt(args.height);    if (args.filter) pageFilterRegexp = new RegExp(args.filter);    if (args.noisy) noisy = true;    if (args.timeout) timeout = parseInt(args.timeout);    forceCC = !args.noForceCC;    doRenderTest = args.doRender;    if (forceCC) {      if (window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)                .getInterface(Components.interfaces.nsIDOMWindowUtils)                .garbageCollect) {        useCCApi = true;      }    }    gIOS = Cc["@mozilla.org/network/io-service;1"]      .getService(Ci.nsIIOService);    if (args.offline)      gIOS.offline = true;    var fileURI = gIOS.newURI(manifestURI, null, null);    pages = plLoadURLsFromURI(fileURI);    if (!pages) {      dumpLine('tp: could not load URLs, quitting');      plStop(true);    }    if (pages.length == 0) {      dumpLine('tp: no pages to test, quitting');      plStop(true);    }    if (startIndex < 0)      startIndex = 0;    if (endIndex == -1 || endIndex >= pages.length)      endIndex = pages.length-1;    if (startIndex > endIndex) {      dumpLine("tp: error: startIndex >= endIndex");      plStop(true);    }    pages = pages.slice(startIndex,endIndex+1);    var pageUrls = pages.map(function(p) { return p.url.spec.toString(); });    report = new Report(pageUrls);    if (doRenderTest)      renderReport = new Report(pageUrls);    pageIndex = 0;    if (args.useBrowserChrome) {      var wwatch = Cc["@mozilla.org/embedcomp/window-watcher;1"]        .getService(Ci.nsIWindowWatcher);      var blank = Cc["@mozilla.org/supports-string;1"]        .createInstance(Ci.nsISupportsString);      blank.data = "about:blank";      browserWindow = wwatch.openWindow        (null, "chrome://browser/content/", "_blank",         "chrome,dialog=no,width=" + winWidth + ",height=" + winHeight, blank);      // get our window out of the way      window.resizeTo(10,10);      var browserLoadFunc = function (ev) {        browserWindow.removeEventListener('load', browserLoadFunc, true);        // do this half a second after load, because we need to be        // able to resize the window and not have it get clobbered        // by the persisted values        setTimeout(function () {                     browserWindow.resizeTo(winWidth, winHeight);                     browserWindow.moveTo(0, 0);                     browserWindow.focus();                     content = browserWindow.getBrowser();                     setTimeout(plLoadPage, 100);                   }, 500);      };      browserWindow.addEventListener('load', browserLoadFunc, true);    } else {      window.resizeTo(winWidth, winHeight);      content = document.getElementById('contentPageloader');      setTimeout(plLoadPage, 250);    }  } catch(e) {    dumpLine(e);    plStop(true);  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/476e732bfce11dd7a47f7931fefaa5f8ee740ad5/pageloader.js/clean/layout/tools/pageloader/pageloader.js