Bug 537787 - Update websocket test to use SpecialPowers. r=ctalbert try: -b do -p all -u mochitests -t none

This commit is contained in:
Josh Matthews 2011-05-24 02:43:05 +03:00
Родитель f0668c3546
Коммит 2694e83b1c
3 изменённых файлов: 9 добавлений и 12 удалений

Просмотреть файл

@ -129,15 +129,11 @@ function CreateTestWS(ws_location, ws_protocol)
function forcegc()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.utils.forceGC();
var wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.garbageCollect();
SpecialPowers.forceGC();
SpecialPowers.gc();
setTimeout(function()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
wu.garbageCollect();
SpecialPowers.gc();
}, 1);
}

Просмотреть файл

@ -22,11 +22,8 @@ var params = ["protocol", "resource", "origin", "end"];
var results = ["test", "/tests/content/base/test/file_ws_basic_tests", "http://mochi.test:8888", "end"];
function forcegc(){
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
Components.utils.forceGC();
var wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.garbageCollect();
SpecialPowers.forceGC();
SpecialPowers.gc();
}
function finishWSTest() {

Просмотреть файл

@ -212,6 +212,10 @@ SpecialPowers.prototype = {
this.DOMWindowUtils.garbageCollect();
},
forceGC: function() {
Components.utils.forceGC();
},
hasContentProcesses: function() {
try {
var rt = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);