diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 9e977b2c818a0f0a97a6a65b9872b95b0d11701c..703f45094ffa60be283f1c7befdc9084c3bacd15 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2008-10-17 Pamela Greene + + Fix potential race by running two passes of test to defer notifyDone. + See https://bugs.webkit.org/show_bug.cgi?id=21576 + + Reviewed by Timothy Hatcher. + + * fast/history/resources/history_reload_window.html: + 2008-10-16 Julien Chaffraix Rubber-stamped by Alexey Proskuryakov. diff --git a/LayoutTests/fast/history/resources/history_reload_window.html b/LayoutTests/fast/history/resources/history_reload_window.html index 46a1e3458ed9d9681541f9fcbf9d0b148843d5e5..d88e9031a79e1706b314ce2f86569cc8b67d8704 100644 --- a/LayoutTests/fast/history/resources/history_reload_window.html +++ b/LayoutTests/fast/history/resources/history_reload_window.html @@ -4,21 +4,26 @@ function test() { var tempConsole = document.getElementById('console'); var console = window.opener.document.getElementById('console'); + // On the first pass, we'll temporarily set the output to + // to failure, and then go(0). On the second pass, + // we set the output back to success and close the window. if (window.opener.i == 0) { tempConsole.innerHTML = 'Test Failed'; console.innerHTML = tempConsole.innerHTML; - window.opener.i = window.opener.i + 1; + window.opener.i = 1; history.go(0); } else { console.innerHTML = tempConsole.innerHTML; + window.opener.i = 2; window.close(); } } function closed() { - if (window.layoutTestController) - opener.setTimeout("layoutTestController.notifyDone()", 0); + if (window.opener.i == 2) + if (window.layoutTestController) + opener.setTimeout("layoutTestController.notifyDone()", 0); }