Bug 589442 - Add a flush in this test in order to increase the chances that the old document survives in the bfcache. r=bent, a=test-only

This commit is contained in:
Markus Stange 2010-11-27 14:52:33 +01:00
parent 512058857b
commit 84b5540f59

View File

@ -1,4 +1,4 @@
<!DOCTYPE HTML>
<!DOCTYPE HTML>
<html>
<head>
<title>Test for DOM Worker Threads</title>
@ -70,7 +70,7 @@
if (finished) {
return;
}
ok(false, "shouldn't get here!");
ok(false, "We don't want suspend_iframe.html to fire a new load event, we want it to come out of the bfcache!");
finishTest();
}
@ -83,7 +83,8 @@
is(resumed, false, "Already resumed?");
setCachePref(false);
suspended = true;
iframe.onload = badOnloadCallback;
var iframeElement = document.getElementById("workerFrame");
iframeElement.onload = badOnloadCallback;
oldMessageCount = lastCount;
interval = setInterval(waitInterval, 1000);
}
@ -100,6 +101,10 @@
if (lastCount == 50) {
setCachePref(true);
iframe.location = "about:blank";
// We want suspend_iframe.html to go into bfcache, so we need to flush
// out all pending notifications. Otherwise, if they're flushed too
// late, they could kick us out of the bfcache again.
iframe.document.body.offsetTop;
}
return;
}