layout/style/test/test_units_frequency.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

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.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for serialization and equivalence of frequency units</title>
     5   <script type="application/javascript" 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">
    13 </div>
    14 <pre id="test">
    15 <script type="application/javascript">
    17 /** Test for serialization and equivalence of frequency units **/
    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 };
    29 var p = document.getElementById("display");
    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 }
    53 </script>
    54 </pre>
    55 </body>
    56 </html>

mercurial