| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta charset="utf-8" /> | 4 <meta charset="utf-8" /> |
| 5 <title>window.performance.now() chronology</title> | 5 <title>window.performance.now() chronology</title> |
| 6 <link rel="author" title="W3C" href="http://www.w3.org/" /> | 6 <link rel="author" title="W3C" href="http://www.w3.org/" /> |
| 7 <link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/> | 7 <link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/> |
| 8 <script src="../../../resources/testharness.js"></script> | 8 <script src="/resources/testharness.js"></script> |
| 9 <script src="../../../resources/testharnessreport.js"></script> | 9 <script src="/resources/testharnessreport.js"></script> |
| 10 <script> | 10 <script> |
| 11 test(function() { | 11 test(function() { |
| 12 assert_true(window.performance.now() > 0, "window.performance.now() returns po
sitive numbers"); | 12 assert_true(window.performance.now() > 0, "window.performance.now() returns po
sitive numbers"); |
| 13 }, "window.performance.now() returns a positive number", {assert: "The time valu
es returned when calling the now method MUST be monotonically increasing and not
subject to system clock adjustments or system clock skew."}); | 13 }, "window.performance.now() returns a positive number", {assert: "The time valu
es returned when calling the now method MUST be monotonically increasing and not
subject to system clock adjustments or system clock skew."}); |
| 14 | 14 |
| 15 test(function() { | 15 test(function() { |
| 16 var now1 = window.performance.now(); | 16 var now1 = window.performance.now(); |
| 17 var now2 = window.performance.now(); | 17 var now2 = window.performance.now(); |
| 18 assert_true((now2-now1) >= 0, "window.performance.now() difference is not ne
gative"); | 18 assert_true((now2-now1) >= 0, "window.performance.now() difference is not ne
gative"); |
| 19 }, | 19 }, |
| 20 "window.performance.now() difference is not negative", | 20 "window.performance.now() difference is not negative", |
| 21 { | 21 { |
| 22 assert: "The difference between any two chronologically recorded time values
returned from the now method MUST never be negative." | 22 assert: "The difference between any two chronologically recorded time values
returned from the now method MUST never be negative." |
| 23 } | 23 } |
| 24 ); | 24 ); |
| 25 | 25 |
| 26 </script> | 26 </script> |
| 27 </head> | 27 </head> |
| 28 <body> | 28 <body> |
| 29 <h1>Description</h1> | 29 <h1>Description</h1> |
| 30 <p>This test validates that window.performance.now() follows the monotonic clock
requirements.</p> | 30 <p>This test validates that window.performance.now() follows the monotonic clock
requirements.</p> |
| 31 | 31 |
| 32 <div id="log"></div> | 32 <div id="log"></div> |
| 33 | 33 |
| 34 </body> | 34 </body> |
| 35 </html> | 35 </html> |
| OLD | NEW |