Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
michael@0 | 3 | <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> |
michael@0 | 4 | |
michael@0 | 5 | <window title="Tree in Popup Test" |
michael@0 | 6 | onload="setTimeout(runTests, 0);" |
michael@0 | 7 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <panel id="panel" onpopupshown="treeClick()" onpopuphidden="SimpleTest.finish()"> |
michael@0 | 13 | <tree id="tree" width="350" rows="5"> |
michael@0 | 14 | <treecols> |
michael@0 | 15 | <treecol id="name" label="Name" flex="1"/> |
michael@0 | 16 | <treecol id="address" label="Street" flex="1"/> |
michael@0 | 17 | </treecols> |
michael@0 | 18 | <treechildren id="treechildren"> |
michael@0 | 19 | <treeitem> |
michael@0 | 20 | <treerow> |
michael@0 | 21 | <treecell label="Justin Thyme"/> |
michael@0 | 22 | <treecell label="800 Bay Street"/> |
michael@0 | 23 | </treerow> |
michael@0 | 24 | </treeitem> |
michael@0 | 25 | <treeitem> |
michael@0 | 26 | <treerow> |
michael@0 | 27 | <treecell label="Mary Goround"/> |
michael@0 | 28 | <treecell label="47 University Avenue"/> |
michael@0 | 29 | </treerow> |
michael@0 | 30 | </treeitem> |
michael@0 | 31 | </treechildren> |
michael@0 | 32 | </tree> |
michael@0 | 33 | </panel> |
michael@0 | 34 | |
michael@0 | 35 | <script class="testbody" type="application/javascript"> |
michael@0 | 36 | <![CDATA[ |
michael@0 | 37 | |
michael@0 | 38 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 39 | |
michael@0 | 40 | function runTests() |
michael@0 | 41 | { |
michael@0 | 42 | $("panel").openPopup(null, "overlap", 2, 2); |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | function treeClick() |
michael@0 | 46 | { |
michael@0 | 47 | var tree = $("tree"); |
michael@0 | 48 | is(tree.currentIndex, -1, "selectedIndex before click"); |
michael@0 | 49 | synthesizeMouseExpectEvent($("treechildren"), 2, 2, { }, $("treechildren"), "click", ""); |
michael@0 | 50 | is(tree.currentIndex, 0, "selectedIndex after click"); |
michael@0 | 51 | |
michael@0 | 52 | var x = { }, y = { }, width = { }, height = { }; |
michael@0 | 53 | tree.treeBoxObject.getCoordsForCellItem(1, tree.columns.address, "", x, y, width, height); |
michael@0 | 54 | synthesizeMouseExpectEvent($("treechildren"), x.value, y.value + 2, |
michael@0 | 55 | { }, $("treechildren"), "click", ""); |
michael@0 | 56 | is(tree.currentIndex, 1, "selectedIndex after second click " + x.value + "," + y.value); |
michael@0 | 57 | |
michael@0 | 58 | $("panel").hidePopup(); |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | ]]> |
michael@0 | 62 | </script> |
michael@0 | 63 | |
michael@0 | 64 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 65 | <p id="display"> |
michael@0 | 66 | </p> |
michael@0 | 67 | <div id="content" style="display: none"> |
michael@0 | 68 | </div> |
michael@0 | 69 | <pre id="test"> |
michael@0 | 70 | </pre> |
michael@0 | 71 | </body> |
michael@0 | 72 | |
michael@0 | 73 | </window> |