1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
# HG changeset patch
# Parent fae4a63127468bd6447453495c82b9f6713888fb
diff --git a/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html b/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html
--- a/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html
+++ b/content/canvas/test/webgl/conformance/extensions/oes-standard-derivatives.html
@@ -116,16 +116,17 @@ if (!gl) {
testPassed("Successfully enabled OES_standard_derivatives extension");
runSupportedTest(true);
runHintTestEnabled();
runShaderTests(true);
runOutputTests();
runUniqueObjectTest();
+ runReferenceCycleTest();
}
}
function runSupportedTest(extensionEnabled) {
var supported = gl.getSupportedExtensions();
if (supported.indexOf("OES_standard_derivatives") >= 0) {
if (extensionEnabled) {
testPassed("OES_standard_derivatives listed as supported and getExtension succeeded");
@@ -365,16 +366,30 @@ function runUniqueObjectTest()
} else if (window.opera && window.opera.collect) {
window.opera.collect();
} else {
attemptToForceGC();
}
shouldBe('gl.getExtension("OES_standard_derivatives").myProperty', '2');
}
+function runReferenceCycleTest()
+{
+ // create some reference cycles. The goal is to see if they cause leaks. The point is that
+ // some browser test runners have instrumentation to detect leaked refcounted objects.
+
+ debug("Testing reference cycles between context and extension objects");
+ var ext = gl.getExtension("OES_standard_derivatives");
+
+ // create cycle between extension and context, since the context has to hold a reference to the extension
+ ext.context = gl;
+
+ // create a self-cycle on the extension object
+ ext.ext = ext;
+}
debug("");
successfullyParsed = true;
</script>
<script>finishTest();</script>
</body>
</html>
diff --git a/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html b/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html
--- a/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html
+++ b/content/canvas/test/webgl/conformance/extensions/oes-texture-float.html
@@ -81,16 +81,17 @@ if (!gl) {
if (!gl.getExtension("OES_texture_float")) {
testPassed("No OES_texture_float support -- this is legal");
} else {
testPassed("Successfully enabled OES_texture_float extension");
runTextureCreationTest(testProgram, true);
runRenderTargetTest(testProgram);
runUniqueObjectTest();
+ runReferenceCycleTest();
}
}
// Needs to be global for shouldBe to see it.
var pixels;
function allocateTexture()
{
@@ -206,16 +207,30 @@ function runUniqueObjectTest()
} else if (window.opera && window.opera.collect) {
window.opera.collect();
} else {
attemptToForceGC();
}
shouldBe('gl.getExtension("OES_texture_float").myProperty', '2');
}
+function runReferenceCycleTest()
+{
+ // create some reference cycles. The goal is to see if they cause leaks. The point is that
+ // some browser test runners have instrumentation to detect leaked refcounted objects.
+
+ debug("Testing reference cycles between context and extension objects");
+ var ext = gl.getExtension("OES_texture_float");
+
+ // create cycle between extension and context, since the context has to hold a reference to the extension
+ ext.context = gl;
+
+ // create a self-cycle on the extension object
+ ext.ext = ext;
+}
debug("");
successfullyParsed = true;
</script>
<script>finishTest();</script>
</body>
</html>
|