Bug 717908 - disable unreliable test. r=igor.

Since we use a conservative gc, this test can fail depending on the memory
layout.

--HG--
extra : rebase_source : dc0f35343a4aa2b911cb582c093a17a50289d299
This commit is contained in:
Rafael Ávila de Espíndola 2012-01-13 11:11:03 -05:00
parent 8ec49ee3f4
commit a8a418330d

View File

@ -1,32 +0,0 @@
function leak_test() {
// Create a reference loop function->script->traceFragment->object->function
// that GC must be able to break. To embedd object into the fragment the
// code use prototype chain of depth 2 which caches obj.__proto__.__proto__
// into the fragment.
// To make sure that we have no references to the function f after this
// function returns due via the conservative scan of the native stack we
// loop here multiple times overwriting the stack and registers with new garabge.
for (var j = 0; j != 8; ++j) {
var f = Function("a", "var s = 0; for (var i = 0; i != 100; ++i) s += a.b; return s;");
var c = {b: 1, f: f, leakDetection: makeFinalizeObserver()};
f({ __proto__: { __proto__: c}});
f = c = a = null;
gc();
}
}
function test()
{
if (typeof finalizeCount != "function")
return;
var base = finalizeCount();
leak_test();
gc();
gc();
var n = finalizeCount();
assertEq(base + 4 < finalizeCount(), true, "Some finalizations must happen");
}
test();