Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 | <?xml-stylesheet href="test_offsets.css" type="text/css"?> |
michael@0 | 5 | <!-- |
michael@0 | 6 | XUL Tests for client/scroll properties |
michael@0 | 7 | --> |
michael@0 | 8 | <window title="Test Offset/Client/Scroll Properties" width="500" height="600" |
michael@0 | 9 | style="margin: 1px !important" |
michael@0 | 10 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 11 | <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 12 | <script type="text/javascript" src="test_offsets.js"/> |
michael@0 | 13 | |
michael@0 | 14 | <vbox id="testelements" style="margin: 0; padding: 0; border: 0;"> |
michael@0 | 15 | <vbox id="vbox" style="margin: 5px 0 0 2px;"> |
michael@0 | 16 | <vbox id="noscroll" align="start"> |
michael@0 | 17 | <button id="button1" label="Button One" style="margin: 0px; padding: 0; border: 0;"/> |
michael@0 | 18 | <button id="button2" label="Button Two" width="140" height="120"/> |
michael@0 | 19 | </vbox> |
michael@0 | 20 | <hbox align="start"> |
michael@0 | 21 | <vbox id="scrollbox" style="overflow: scroll; padding: 2px; margin: 3px; border: 4px solid green;" |
michael@0 | 22 | maxwidth="66" maxheight="56"> |
michael@0 | 23 | <label value="One" style="margin: 0"/> |
michael@0 | 24 | <label id="scrollchild" value="Two"/> |
michael@0 | 25 | <label value="Three"/> |
michael@0 | 26 | <label id="lastline" value="This fourth label is much longer than the others" |
michael@0 | 27 | style="margin: 0; padding: 0; border: 0;"/> |
michael@0 | 28 | </vbox> |
michael@0 | 29 | <vbox id="scrollbox-test"> |
michael@0 | 30 | <scrollbar orient="vertical" style="border: 0; padding: 0;"/> |
michael@0 | 31 | </vbox> |
michael@0 | 32 | </hbox> |
michael@0 | 33 | </vbox> |
michael@0 | 34 | |
michael@0 | 35 | <svg:svg id="svgbase" width="45" height="20" xmlns:svg="http://www.w3.org/2000/svg"> |
michael@0 | 36 | <svg:rect id="svgrect" x="3" y="5" width="45" height="20" fill="red"/> |
michael@0 | 37 | </svg:svg> |
michael@0 | 38 | |
michael@0 | 39 | </vbox> |
michael@0 | 40 | |
michael@0 | 41 | <button id="outermenu" type="menu" label="Menu"> |
michael@0 | 42 | <menupopup id="outerpopup" |
michael@0 | 43 | style="margin-left: 5px; padding-left: 3px; padding: 0;" |
michael@0 | 44 | onpopupshown="this.firstChild.open = true" |
michael@0 | 45 | onpopuphidden="if (event.target == this) SimpleTest.finish();"> |
michael@0 | 46 | <menu id="innermenu" label="Open" |
michael@0 | 47 | style="margin: 0; padding: 0; border: 2px black solid; -moz-appearance: none;"> |
michael@0 | 48 | <menupopup style="margin: 0; padding: 0; border: 1px black solid; -moz-appearance: none;" |
michael@0 | 49 | onpopupshown="testElements('outermenu', doneTests)"> |
michael@0 | 50 | <menuitem label="Document"/> |
michael@0 | 51 | <menuitem id="innermenuitem" style="margin: 2px; padding: 3px;" label="Page"/> |
michael@0 | 52 | </menupopup> |
michael@0 | 53 | </menu> |
michael@0 | 54 | <menuitem id="outermenuitem" label="Close"/> |
michael@0 | 55 | </menupopup> |
michael@0 | 56 | </button> |
michael@0 | 57 | |
michael@0 | 58 | <!-- test results are displayed in the html:body --> |
michael@0 | 59 | <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
michael@0 | 60 | |
michael@0 | 61 | <!-- test code goes here --> |
michael@0 | 62 | <script type="application/javascript"><![CDATA[ |
michael@0 | 63 | |
michael@0 | 64 | var gTestSet = "box"; |
michael@0 | 65 | |
michael@0 | 66 | var whichpopup = "outer"; |
michael@0 | 67 | |
michael@0 | 68 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 69 | |
michael@0 | 70 | function startTests() |
michael@0 | 71 | { |
michael@0 | 72 | testElements('testelements', doneTests); |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | function doneTests() |
michael@0 | 76 | { |
michael@0 | 77 | if (gTestSet == "box") { |
michael@0 | 78 | gTestSet = "popup"; |
michael@0 | 79 | // only test this on Mac for now |
michael@0 | 80 | if (navigator.platform.indexOf("Mac") >= 0) { |
michael@0 | 81 | checkScrollState($("outerpopup"), 0, 0, 0, 0, "popup before open"); |
michael@0 | 82 | checkClientState($("outerpopup"), 0, 0, 0, 0, "popup before open"); |
michael@0 | 83 | } |
michael@0 | 84 | $("outermenu").open = true; |
michael@0 | 85 | } |
michael@0 | 86 | else { |
michael@0 | 87 | $("outermenu").open = false; |
michael@0 | 88 | } |
michael@0 | 89 | } |
michael@0 | 90 | |
michael@0 | 91 | SimpleTest.waitForFocus(startTests); |
michael@0 | 92 | |
michael@0 | 93 | ]]> |
michael@0 | 94 | </script> |
michael@0 | 95 | |
michael@0 | 96 | </window> |