toolkit/content/tests/chrome/test_progressmeter.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.

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 XUL Widget Test for progressmeter
michael@0 6 -->
michael@0 7 <window title="Progressmeter" width="500" height="600"
michael@0 8 onload="doTests()"
michael@0 9 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
michael@0 10 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11
michael@0 12 <progressmeter id="n1"/>
michael@0 13 <progressmeter id="n2" mode="undetermined"/>
michael@0 14
michael@0 15 <!-- test results are displayed in the html:body -->
michael@0 16 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
michael@0 17
michael@0 18 <!-- test code goes here -->
michael@0 19 <script type="application/javascript"><![CDATA[
michael@0 20 SimpleTest.waitForExplicitFinish();
michael@0 21
michael@0 22 function doTests() {
michael@0 23 var n1 = document.getElementById("n1");
michael@0 24 var n2 = document.getElementById("n2");
michael@0 25
michael@0 26 SimpleTest.ise(n1.mode, "", "mode determined");
michael@0 27 SimpleTest.ise(n2.mode, "undetermined", "mode undetermined");
michael@0 28
michael@0 29 SimpleTest.ise(n1.value, "0", "determined value");
michael@0 30 SimpleTest.ise(n2.value, "0", "undetermined value");
michael@0 31
michael@0 32 // values can only be incremented in multiples of 4
michael@0 33 n1.value = 2;
michael@0 34 SimpleTest.ise(n1.value, "0", "determined value set 2");
michael@0 35 n1.value = -1;
michael@0 36 SimpleTest.ise(n1.value, "0", "determined value set -1");
michael@0 37 n1.value = 125;
michael@0 38 SimpleTest.ise(n1.value, "100", "determined value set 125");
michael@0 39 n1.value = 7;
michael@0 40 SimpleTest.ise(n1.value, "7", "determined value set 7");
michael@0 41 n1.value = "17";
michael@0 42 SimpleTest.ise(n1.value, "17", "determined value set 17 string");
michael@0 43 n1.value = 18;
michael@0 44 SimpleTest.ise(n1.value, "17", "determined value set 18");
michael@0 45 n1.value = "Cat";
michael@0 46 SimpleTest.ise(n1.value, "17", "determined value set invalid");
michael@0 47
michael@0 48 n1.max = 200;
michael@0 49 is(n1.max, 200, "max changed");
michael@0 50 n1.value = 150;
michael@0 51 n1.max = 120;
michael@0 52 is(n1.value, 120, "max lowered below value");
michael@0 53
michael@0 54 n2.value = 2;
michael@0 55 SimpleTest.ise(n2.value, "0", "undetermined value set 2");
michael@0 56 n2.value = -1;
michael@0 57 SimpleTest.ise(n2.value, "0", "undetermined value set -1");
michael@0 58 n2.value = 125;
michael@0 59 SimpleTest.ise(n2.value, "100", "undetermined value set 125");
michael@0 60 n2.value = 7;
michael@0 61 SimpleTest.ise(n2.value, "7", "undetermined value set 7");
michael@0 62 n2.value = "17";
michael@0 63 SimpleTest.ise(n2.value, "17", "undetermined value set 17 string");
michael@0 64 n2.value = 18;
michael@0 65 SimpleTest.ise(n2.value, "17", "undetermined value set 18");
michael@0 66 n2.value = "Cat";
michael@0 67 SimpleTest.ise(n2.value, "17", "determined value set invalid");
michael@0 68
michael@0 69 SimpleTest.finish();
michael@0 70 }
michael@0 71
michael@0 72 ]]></script>
michael@0 73
michael@0 74 </window>

mercurial