layout/base/tests/chrome/chrome_content_integration_window.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
     3 <window title="Content/chrome integration subwindow"
     4         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     5         onload="runTests()"
     6         style="background:black; -moz-appearance:none;">
     7   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
     9   <stack style="height:300px; width:200px;">
    10     <!-- the bottom 100px is a strip of black that should be vixible through the content iframe -->
    11     <vbox style="background:pink; border-bottom:100px solid black"/>
    12     <!-- the middle 100px is a strip of black in the content iframe -->
    13     <!-- the bottom 100px of the iframe is transparent, the top 100px is yellow -->
    14     <iframe type="content" style="border:none;"
    15             transparent="transparent"
    16             src="data:text/html,&lt;div style='position:absolute;left:0;top:0;width:100%;height:100px;background:yellow;border-bottom:100px solid black'&gt;"/>
    17     <!-- the top 100px is a strip of black above the content iframe -->
    18     <vbox style="border-top:100px solid black;"/>
    19   </stack>
    21   <script type="application/javascript">
    22     <![CDATA[
    23     var imports = [ "SimpleTest", "is", "isnot", "ok", "SpecialPowers" ];
    24     for each (var name in imports) {
    25       window[name] = window.opener.wrappedJSObject[name];
    26     }
    28     function runTests() {
    29       var testCanvas = snapshotWindow(window);
    31       var refCanvas = snapshotWindow(window);
    32       var ctx = refCanvas.getContext('2d');
    33       ctx.fillStyle = "black";
    34       ctx.fillRect(0, 0, refCanvas.width, refCanvas.height);
    36       var comparison = compareSnapshots(testCanvas, refCanvas, true);
    37       ok(comparison[0], "Rendering OK, got " + comparison[1] + ", expected " + comparison[2]);
    39       var tester = window.SimpleTest;
    40       window.close();
    41       tester.finish();
    42     }
    43     ]]>
    44   </script>
    45 </window>

mercurial