toolkit/content/tests/chrome/test_popup_tree.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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" type="text/css"?>
     5 <window title="Tree in Popup Test"
     6         onload="setTimeout(runTests, 0);"
     7         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>      
    10   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>      
    12 <panel id="panel" onpopupshown="treeClick()" onpopuphidden="SimpleTest.finish()">
    13   <tree id="tree" width="350" rows="5">
    14     <treecols>
    15       <treecol id="name" label="Name" flex="1"/>
    16       <treecol id="address" label="Street" flex="1"/>
    17     </treecols>
    18     <treechildren id="treechildren">
    19       <treeitem>
    20         <treerow>
    21           <treecell label="Justin Thyme"/>
    22           <treecell label="800 Bay Street"/>
    23         </treerow>
    24       </treeitem>
    25       <treeitem>
    26         <treerow>
    27           <treecell label="Mary Goround"/>
    28           <treecell label="47 University Avenue"/>
    29         </treerow>
    30       </treeitem>
    31     </treechildren>
    32   </tree>
    33 </panel>
    35 <script class="testbody" type="application/javascript">
    36 <![CDATA[
    38 SimpleTest.waitForExplicitFinish();
    40 function runTests()
    41 {
    42   $("panel").openPopup(null, "overlap", 2, 2);
    43 }
    45 function treeClick()
    46 {
    47   var tree = $("tree");
    48   is(tree.currentIndex, -1, "selectedIndex before click");
    49   synthesizeMouseExpectEvent($("treechildren"), 2, 2, { }, $("treechildren"), "click", "");
    50   is(tree.currentIndex, 0, "selectedIndex after click");
    52   var x = { }, y = { }, width = { }, height = { };
    53   tree.treeBoxObject.getCoordsForCellItem(1, tree.columns.address, "", x, y, width, height);
    54   synthesizeMouseExpectEvent($("treechildren"), x.value, y.value + 2,
    55                              { }, $("treechildren"), "click", "");
    56   is(tree.currentIndex, 1, "selectedIndex after second click " + x.value + "," + y.value);
    58   $("panel").hidePopup();
    59 }
    61 ]]>
    62 </script>
    64 <body xmlns="http://www.w3.org/1999/xhtml">
    65 <p id="display">
    66 </p>
    67 <div id="content" style="display: none">
    68 </div>
    69 <pre id="test">
    70 </pre>
    71 </body>
    73 </window>

mercurial