content/canvas/test/webgl-conformance/reference-cycle-test.patch

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial