Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test for serialization and equivalence of time units</title> |
michael@0 | 5 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 7 | </head> |
michael@0 | 8 | <body> |
michael@0 | 9 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> |
michael@0 | 10 | <p id="display"></p> |
michael@0 | 11 | <div id="content" style="display: none"> |
michael@0 | 12 | |
michael@0 | 13 | </div> |
michael@0 | 14 | <pre id="test"> |
michael@0 | 15 | <script type="application/javascript"> |
michael@0 | 16 | |
michael@0 | 17 | /** Test for serialization and equivalence of time units **/ |
michael@0 | 18 | |
michael@0 | 19 | /** |
michael@0 | 20 | * We test that for each of the following: |
michael@0 | 21 | * + they reserialize to exactly what is given |
michael@0 | 22 | * + if a mapping is provided, they compute to the same result as the mapping |
michael@0 | 23 | */ |
michael@0 | 24 | var tests = { |
michael@0 | 25 | "3s": "3000ms", |
michael@0 | 26 | "500ms": "0.5s" |
michael@0 | 27 | }; |
michael@0 | 28 | |
michael@0 | 29 | var p = document.getElementById("display"); |
michael@0 | 30 | |
michael@0 | 31 | for (var test in tests) { |
michael@0 | 32 | p.setAttribute("style", "transition-duration: " + test); |
michael@0 | 33 | is(p.style.getPropertyValue("transition-duration"), test, |
michael@0 | 34 | test + " serializes to exactly itself"); |
michael@0 | 35 | var equiv = tests[test]; |
michael@0 | 36 | if (equiv) { |
michael@0 | 37 | var cm1 = getComputedStyle(p, "").transitionDuration; |
michael@0 | 38 | p.style.transitionDuration = equiv; |
michael@0 | 39 | var cm2 = getComputedStyle(p, "").transitionDuration; |
michael@0 | 40 | is(cm1, cm2, test + " should compute to the same as " + equiv); |
michael@0 | 41 | } |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | </script> |
michael@0 | 45 | </pre> |
michael@0 | 46 | </body> |
michael@0 | 47 | </html> |