content/canvas/crashtests/421715-1.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE html>
     2 <html>
     3   <head>
     4     <script type="text/javascript">
     5       function stringify(a) {
     6         if (a)
     7           return a.toSource();
     8         return ''+a;
     9       }
    10       var args = [undefined, null, [], {}, 0, "0"];
    11       var stringArgs = args.map(stringify);
    13       function test_method(context, method, arity) {
    14         function testParams(existingParams, depth) {
    15           for (var arg of stringArgs) {
    16             var code = "context[method](" + existingParams + arg + ")";
    17             try {
    18               eval(code);
    19             } catch (ex) {
    20               // Exceptions are expected
    21             }
    23             if (depth < arity)
    24               testParams(existingParams + arg + ",", depth + 1);
    25           }
    26         }
    27         testParams("", 1);
    28       }
    30       function startTest() {
    31         var canvas = document.getElementById("img");
    32         var context = canvas.getContext('2d');;
    33         test_method(context, "getImageData", 4);
    34         test_method(context, "putImageData", 3);
    35       }
    36     </script>
    37   </head>
    38   <body onload="startTest()">
    39     <canvas id="img">No canvas support.</canvas>
    40   </body>
    41 </html>

mercurial