michael@0: # HG changeset patch michael@0: # Parent f9585cefcf568dbc2a6ce81f16a2048365af7ed2 michael@0: michael@0: diff --git a/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html b/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html michael@0: --- a/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html michael@0: +++ b/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html michael@0: @@ -337,42 +337,21 @@ function runOutputTests() { michael@0: setupBuffers(1.0, 0.5, 0.5, 0.0); michael@0: wtu.drawQuad(gl); michael@0: expectResult([3, 3, 5, 255], michael@0: "Draw 4 (variation in x & y) returned the correct data", michael@0: "Draw 4 (variation in x & y) returned incorrect data"); michael@0: michael@0: } michael@0: michael@0: -function attemptToForceGC() michael@0: -{ michael@0: - var holderArray = []; michael@0: - var tempArray; michael@0: - window.tempArray = holderArray; michael@0: - for (var i = 0; i < 12; ++i) { michael@0: - tempArray = []; michael@0: - for (var j = 0; j < 1024 * 1024; ++j) { michael@0: - tempArray.push(0); michael@0: - } michael@0: - holderArray.push(tempArray); michael@0: - } michael@0: - window.tempArray = null; michael@0: -} michael@0: - michael@0: function runUniqueObjectTest() michael@0: { michael@0: debug("Testing that getExtension() returns the same object each time"); michael@0: gl.getExtension("OES_standard_derivatives").myProperty = 2; michael@0: - if (window.GCController) { michael@0: - window.GCController.collect(); michael@0: - } else if (window.opera && window.opera.collect) { michael@0: - window.opera.collect(); michael@0: - } else { michael@0: - attemptToForceGC(); michael@0: - } michael@0: + gc(); michael@0: shouldBe('gl.getExtension("OES_standard_derivatives").myProperty', '2'); michael@0: } michael@0: michael@0: function runReferenceCycleTest() michael@0: { michael@0: // create some reference cycles. The goal is to see if they cause leaks. The point is that michael@0: // some browser test runners have instrumentation to detect leaked refcounted objects. michael@0: michael@0: diff --git a/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html b/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html michael@0: --- a/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html michael@0: +++ b/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html michael@0: @@ -178,42 +178,21 @@ function runRenderTargetTest(testProgram michael@0: gl.bindTexture(gl.TEXTURE_2D, texture); michael@0: gl.useProgram(testProgram); michael@0: gl.uniform1i(gl.getUniformLocation(testProgram, "tex"), 0); michael@0: wtu.drawQuad(gl); michael@0: glErrorShouldBe(gl, gl.NO_ERROR, "rendering from floating-point texture should succeed"); michael@0: checkRenderingResults(); michael@0: } michael@0: michael@0: -function attemptToForceGC() michael@0: -{ michael@0: - var holderArray = []; michael@0: - var tempArray; michael@0: - window.tempArray = holderArray; michael@0: - for (var i = 0; i < 12; ++i) { michael@0: - tempArray = []; michael@0: - for (var j = 0; j < 1024 * 1024; ++j) { michael@0: - tempArray.push(0); michael@0: - } michael@0: - holderArray.push(tempArray); michael@0: - } michael@0: - window.tempArray = null; michael@0: -} michael@0: - michael@0: function runUniqueObjectTest() michael@0: { michael@0: debug("Testing that getExtension() returns the same object each time"); michael@0: gl.getExtension("OES_texture_float").myProperty = 2; michael@0: - if (window.GCController) { michael@0: - window.GCController.collect(); michael@0: - } else if (window.opera && window.opera.collect) { michael@0: - window.opera.collect(); michael@0: - } else { michael@0: - attemptToForceGC(); michael@0: - } michael@0: + gc(); michael@0: shouldBe('gl.getExtension("OES_texture_float").myProperty', '2'); michael@0: } michael@0: michael@0: function runReferenceCycleTest() michael@0: { michael@0: // create some reference cycles. The goal is to see if they cause leaks. The point is that michael@0: // some browser test runners have instrumentation to detect leaked refcounted objects. michael@0: michael@0: diff --git a/content/canvas/test/webgl/resources/js-test-pre.js b/content/canvas/test/webgl/resources/js-test-pre.js michael@0: --- a/content/canvas/test/webgl/resources/js-test-pre.js michael@0: +++ b/content/canvas/test/webgl/resources/js-test-pre.js michael@0: @@ -435,29 +435,42 @@ function assertMsg(assertion, msg) { michael@0: if (assertion) { michael@0: testPassed(msg); michael@0: } else { michael@0: testFailed(msg); michael@0: } michael@0: } michael@0: michael@0: function gc() { michael@0: - if (typeof GCController !== "undefined") michael@0: - GCController.collect(); michael@0: - else { michael@0: - function gcRec(n) { michael@0: - if (n < 1) michael@0: - return {}; michael@0: - var temp = {i: "ab" + i + (i / 100000)}; michael@0: - temp += "foo"; michael@0: - gcRec(n-1); michael@0: - } michael@0: - for (var i = 0; i < 1000; i++) michael@0: - gcRec(10) michael@0: + if (window.GCController) { michael@0: + window.GCController.collect(); michael@0: + return; michael@0: } michael@0: + michael@0: + if (window.opera && window.opera.collect) { michael@0: + window.opera.collect(); michael@0: + return; michael@0: + } michael@0: + michael@0: + try { michael@0: + window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) michael@0: + .getInterface(Components.interfaces.nsIDOMWindowUtils) michael@0: + .garbageCollect(); michael@0: + return; michael@0: + } catch(e) {} michael@0: + michael@0: + function gcRec(n) { michael@0: + if (n < 1) michael@0: + return {}; michael@0: + var temp = {i: "ab" + i + (i / 100000)}; michael@0: + temp += "foo"; michael@0: + gcRec(n-1); michael@0: + } michael@0: + for (var i = 0; i < 1000; i++) michael@0: + gcRec(10); michael@0: } michael@0: michael@0: function finishTest() { michael@0: successfullyParsed = true; michael@0: var epilogue = document.createElement("script"); michael@0: epilogue.onload = function() { michael@0: if (window.nonKhronosFrameworkNotifyDone) { michael@0: window.nonKhronosFrameworkNotifyDone();