test_units_frequency.html (1518B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test for serialization and equivalence of frequency units</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 7 </head> 8 <body> 9 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> 10 <p id="display"></p> 11 <div id="content" style="display: none"> 12 13 </div> 14 <pre id="test"> 15 <script type="application/javascript"> 16 17 /** Test for serialization and equivalence of frequency units */ 18 19 /** 20 * We test that for each of the following: 21 * + they reserialize to exactly what is given 22 * + if a mapping is provided, they compute to the same result as the mapping 23 */ 24 var tests = { 25 "7kHz": "7000Hz", 26 "300Hz": "0.3khz" 27 }; 28 29 var p = document.getElementById("display"); 30 31 for (var test in tests) { 32 // We can't test this because we no longer support any properties 33 // with frequency values. 34 todo(false, "no tests to run, for now"); 35 /* 36 p.setAttribute("style", "pitch: " + test); 37 is(p.style.getPropertyValue("pitch"), test, 38 test + " serializes to exactly itself"); 39 */ 40 // We can't test any equivalence since we don't have any properties 41 // with frequency values that we compute. 42 /* 43 var equiv = tests[test]; 44 if (equiv) { 45 var cm1 = getComputedStyle(p, "").pitch; 46 p.style.pitch = equiv; 47 var cm2 = getComputedStyle(p, "").pitch; 48 is(cm1, cm2, test + " should compute to the same as " + equiv); 49 } 50 */ 51 } 52 53 </script> 54 </pre> 55 </body> 56 </html>