Bug 432055: applicationCache.status is 0 through the update process, patch by dcamp@mozilla.com, r+sr=jst, a=schrep

This commit is contained in:
gavin@gavinsharp.com 2008-05-08 17:09:26 -07:00
Родитель fbb01ec7a8
Коммит f79bc95a3c
2 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@ -99,8 +99,13 @@ function manifestUpdated()
if (OfflineTest.setup()) {
applicationCache.onerror = OfflineTest.failEvent;
applicationCache.onchecking = function() { gGotChecking = true; };
applicationCache.ondownloading = function() { gGotDownloading = true; };
applicationCache.onchecking = function() {
OfflineTest.is(applicationCache.status, 2, "CHECKING state while checking");
gGotChecking = true;
};
applicationCache.ondownloading = function() {
OfflineTest.is(applicationCache.status, 3, "DOWNLOADING state while checking")
gGotDownloading = true; };
applicationCache.oncached = OfflineTest.priv(manifestUpdated);
}

Просмотреть файл

@ -1232,11 +1232,14 @@ nsOfflineCacheUpdate::GetStatus(PRUint16 *aStatus)
{
switch (mState) {
case STATE_CHECKING :
return nsIDOMOfflineResourceList::CHECKING;
*aStatus = nsIDOMOfflineResourceList::CHECKING;
return NS_OK;
case STATE_DOWNLOADING :
return nsIDOMOfflineResourceList::DOWNLOADING;
*aStatus = nsIDOMOfflineResourceList::DOWNLOADING;
return NS_OK;
default :
return nsIDOMOfflineResourceList::IDLE;
*aStatus = nsIDOMOfflineResourceList::IDLE;
return NS_OK;
}
return NS_ERROR_FAILURE;