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="Hidden Popup Test" |
michael@0 | 6 | onload="setTimeout(runTests, 0, $('popup'));" |
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 | |
michael@0 | 11 | <menupopup id="popup" hidden="true" onpopupshown="ok(true, 'popupshown'); this.hidePopup()" |
michael@0 | 12 | onpopuphidden="$('popup-hideonshow').openPopup(null, 'after_start')"> |
michael@0 | 13 | <menuitem id="i1" label="One"/> |
michael@0 | 14 | <menuitem id="i2" label="Two"/> |
michael@0 | 15 | </menupopup> |
michael@0 | 16 | |
michael@0 | 17 | <menupopup id="popup-hideonshow" onpopupshowing="hidePopupWhileShowing(this)" |
michael@0 | 18 | onpopupshown="ok(false, 'popupshown when hidden')"> |
michael@0 | 19 | <menuitem id="i1" label="One"/> |
michael@0 | 20 | <menuitem id="i2" label="Two"/> |
michael@0 | 21 | </menupopup> |
michael@0 | 22 | |
michael@0 | 23 | <button id="button" type="menu" label="Menu" onDOMAttrModified="checkEndTest(event)"> |
michael@0 | 24 | <menupopup id="popupinbutton" hidden="true" |
michael@0 | 25 | onpopupshown="ok(true, 'popupshown'); ok($('button').open, 'open'); this.hidden = true;"> |
michael@0 | 26 | <menuitem id="i1" label="One"/> |
michael@0 | 27 | <menuitem id="i2" label="Two"/> |
michael@0 | 28 | </menupopup> |
michael@0 | 29 | </button> |
michael@0 | 30 | |
michael@0 | 31 | <script class="testbody" type="application/javascript"> |
michael@0 | 32 | <![CDATA[ |
michael@0 | 33 | |
michael@0 | 34 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 35 | |
michael@0 | 36 | function runTests(popup) |
michael@0 | 37 | { |
michael@0 | 38 | popup.hidden = false; |
michael@0 | 39 | popup.openPopup(null, "after_start"); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | function hidePopupWhileShowing(popup) |
michael@0 | 43 | { |
michael@0 | 44 | popup.hidden = true; |
michael@0 | 45 | popup.clientWidth; // flush layout |
michael@0 | 46 | is(popup.state, 'closed', 'popupshowing hidden'); |
michael@0 | 47 | SimpleTest.executeSoon(function () runTests($('popupinbutton'))); |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | function checkEndTest(event) |
michael@0 | 51 | { |
michael@0 | 52 | var button = $("button"); |
michael@0 | 53 | if (event.originalTarget != button || event.attrName != 'open' || event.attrChange != event.REMOVAL) |
michael@0 | 54 | return; |
michael@0 | 55 | |
michael@0 | 56 | ok($("popupinbutton").hidden, "popup hidden"); |
michael@0 | 57 | is($("popupinbutton").state, "closed", "popup state"); |
michael@0 | 58 | ok(!button.open, "not open after hidden"); |
michael@0 | 59 | SimpleTest.finish(); |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | ]]> |
michael@0 | 63 | </script> |
michael@0 | 64 | |
michael@0 | 65 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 66 | <p id="display"> |
michael@0 | 67 | </p> |
michael@0 | 68 | <div id="content" style="display: none"> |
michael@0 | 69 | </div> |
michael@0 | 70 | <pre id="test"> |
michael@0 | 71 | </pre> |
michael@0 | 72 | </body> |
michael@0 | 73 | |
michael@0 | 74 | </window> |