gfx/tests/unit/test_nsIScriptableRegion.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/tests/unit/test_nsIScriptableRegion.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +function run_test()
     1.5 +{
     1.6 +  // XXX Work around for the fact that for non-libxul builds loading gfx
     1.7 +  // components doesn't call up the layout initialisation routine. This should
     1.8 +  // be fixed/improved by bug 515595.
     1.9 +  Components.classes["@mozilla.org/layout/xul-boxobject-tree;1"]
    1.10 +            .createInstance(Components.interfaces.nsIBoxObject);
    1.11 +
    1.12 +  let rgn = Components.classes["@mozilla.org/gfx/region;1"].createInstance(Components.interfaces.nsIScriptableRegion);
    1.13 +  do_check_true (rgn.getRects() === null)
    1.14 +  rgn.unionRect(0,0,80,60);
    1.15 +  do_check_true (rgn.getRects().toString() == "0,0,80,60")
    1.16 +  rgn.unionRect(90,70,1,1);
    1.17 +  do_check_true (rgn.getRects().toString() == "0,0,80,60,90,70,1,1")
    1.18 +}
    1.19 +

mercurial