Bug 873864 - Test failures when reloading test_bug669671.html. r=jlebar

This commit is contained in:
Martijn Wargers 2013-07-26 00:57:25 +02:00
parent b505bca21b
commit 3bee00b4eb
2 changed files with 8 additions and 1 deletions

View File

@ -1,8 +1,9 @@
function handleRequest(request, response)
{
var count = parseInt(getState('count'));
if (!count)
if (!count || request.queryString == 'countreset')
count = 0;
setState('count', count + 1 + '');
response.setHeader('Content-Type', 'text/html', false);

View File

@ -66,6 +66,12 @@ function checkPopupLoadCount()
function test()
{
// Step 0 - Make sure the count is reset to 0 in case of reload
popup.location = 'file_bug669671.sjs?countreset';
yield;
is(popup.document.body.innerHTML, '0',
'Load count should be reset to 0');
// Step 1 - The popup's body counts how many times we've requested the
// resource. This is the first time we've requested it, so it should be '0'.
checkPopupLoadCount();