diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 16:40:45 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 16:40:45 +0000 |
commit | d6f0c649a8584be915f1ef12abbaab318b50376c (patch) | |
tree | abea12dddc6e31cc6c20431db8cee406d6f8aa81 | |
parent | 03b1190c3136f5e7dc9a2200afaae563f05019a8 (diff) | |
download | chromium_src-d6f0c649a8584be915f1ef12abbaab318b50376c.zip chromium_src-d6f0c649a8584be915f1ef12abbaab318b50376c.tar.gz chromium_src-d6f0c649a8584be915f1ef12abbaab318b50376c.tar.bz2 |
Increase the pause() for the re-stopped portion of the interval test to try to prevent timer races.
Add debugging information to the check() to see what values the timer is actually returning.
Review URL: http://codereview.chromium.org/42359
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12095 0039d316-1c4b-4281-b951-d872f2087c98
-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> |