diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/data/layout_tests/chrome/fast/dom/extensions/interval.html | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/webkit/data/layout_tests/chrome/fast/dom/extensions/interval.html b/webkit/data/layout_tests/chrome/fast/dom/extensions/interval.html index 2f34cb5..f4bd7b9 100644 --- a/webkit/data/layout_tests/chrome/fast/dom/extensions/interval.html +++ b/webkit/data/layout_tests/chrome/fast/dom/extensions/interval.html @@ -12,11 +12,11 @@ if (window.layoutTestController) { var resultDiv = document.getElementById("result"); -function check(name, passed) { +function check(name, passed, debug_output) { if (passed) { resultDiv.innerHTML += "PASS - " + name + "<br>"; } else { - resultDiv.innerHTML += "FAIL - " + name + "<br>"; + resultDiv.innerHTML += "FAIL - " + name + ", debug_output: " + debug_output + "<br>"; } } @@ -31,37 +31,43 @@ function test() { var interval = new chromium.Interval(); // Verify initialization. - check("initial zero", interval.microseconds() == 0); + var ms = interval.microseconds(); + check("initial zero", ms == 0, "[ms: " + ms + "]"); // Verify that starting the timer works. interval.start(); pause(500); - check("start", interval.microseconds() >= 500000); + ms = interval.microseconds(); + check("start", ms >= 500000, "[ms: " + ms + "]"); // Verify that restarting the interval should reset the beginning time interval.start(); pause(1); - check("restart", interval.microseconds() > 0 && interval.microseconds() < 500000); + ms = interval.microseconds(); + check("restart", ms > 0 && ms < 500000, "[ms: " + ms + "]"); // Verify that calling stop() before start() has no effect. var interval = new chromium.Interval(); interval.stop(); - check("initial stop", interval.microseconds() == 0); + ms = interval.microseconds(); + check("initial stop", ms == 0, "[ms: " + ms + "]"); // Verify a start/stop sequence. interval.start(); pause(50); interval.stop(); - var ms = interval.microseconds(); - check("stop", ms > 0 && ms < 1000000); + ms = interval.microseconds(); + check("stop", ms > 0 && ms < 1000000, "[ms: " + ms + "]"); // Verify that the timer is really stopped. - check("stopped", ms == interval.microseconds()); + var ms2 = interval.microseconds(); + check("stopped", ms == ms2, "[ms: " + ms + "]" + "[ms2: " + ms2 + "]"); // Verify that re-stopping the timer works. - pause(50); + pause(500); interval.stop(); - check("re-stopped", interval.microseconds() > ms); + ms2 = interval.microseconds(); + check("re-stopped", ms2 > ms, "[ms: " + ms + "]" + "[ms2: " + ms2 + "]"); } </script> </body> |