Bug 1906125 - [devtools] Implement memory panel odd background in CSS instead of...
[gecko.git] / widget / tests / test_bug485118.xhtml
blob5c635f29820387a077b5a89223e052d7939da554
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
4 type="text/css"?>
5 <!--
6 https://bugzilla.mozilla.org/show_bug.cgi?id=485118
7 -->
8 <window title="Mozilla Bug 485118"
9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
11 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
13 <body xmlns="http://www.w3.org/1999/xhtml">
14 <div id="content" style="display: none">
16 </div>
17 <pre id="test">
18 </pre>
19 </body>
21 <hbox height="300">
22 <vbox width="300">
23 <scrollbar orient="horizontal"
24 maxpos="10000"
25 pageincrement="1"
26 id="horizontal"/>
27 <scrollbar orient="horizontal"
28 maxpos="10000"
29 pageincrement="1"
30 style="appearance: auto; -moz-default-appearance: scrollbar-small;"
31 id="horizontalSmall"/>
32 <hbox flex="1">
33 <scrollbar orient="vertical"
34 maxpos="10000"
35 pageincrement="1"
36 id="vertical"/>
37 <scrollbar orient="vertical"
38 maxpos="10000"
39 pageincrement="1"
40 style="appearance: auto; -moz-default-appearance: scrollbar-small;"
41 id="verticalSmall"/>
42 <spacer flex="1"/>
43 </hbox>
44 </vbox>
45 </hbox>
47 <script class="testbody" type="application/javascript">
48 <![CDATA[
50 SimpleTest.waitForExplicitFinish();
52 function runTest() {
53 ["horizontal", "vertical"].forEach(function (orient) {
54 ["", "Small"].forEach(function (size) {
55 var elem = document.getElementById(orient + size);
56 var thumbRect = SpecialPowers.unwrap(
57 SpecialPowers.InspectorUtils.getChildrenForNode(elem, true, false)[0])
58 .childNodes[0].getBoundingClientRect();
59 var sizeToCheck = orient == "horizontal" ? "width" : "height";
60 // var expectedSize = size == "Small" ? 19 : 26;
61 var expectedSize = 26;
62 is(thumbRect[sizeToCheck], expectedSize, size + " scrollbar has wrong minimum " + sizeToCheck);
63 });
64 });
65 SimpleTest.finish();
67 window.addEventListener("load", runTest);
69 ]]>
70 </script>
72 </window>