Closed
Bug 864834
Opened 13 years ago
Closed 12 years ago
appcache cached event not firing
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: miker, Assigned: mayhemer)
References
Details
Attachments
(1 file)
|
73.34 KB,
patch
|
Details | Diff | Splinter Review |
Running the tests individually works just fine:
./mach mochitest-browser browser/devtools/commandline/test/browser_cmd_appcache_invalid.js
./mach mochitest-browser browser/devtools/commandline/test/browser_cmd_appcache_valid.js
But no cached event is raised when running the tests in a batch (stopping the 2nd test dead):
./mach mochitest-browser browser/devtools/commandline/test/
browser_cmd_appcache_invalid contains an invalid appcache. When prompted to allow this site to store offline content the allow button is clicked. Because the appcache is invalid an error event is raised as planned and the test runs through successfully.
browser_cmd_appcache_valid contains a valid appcache. Because the previous test allowed example.com to store offline data there is no prompt this time. The progress event is raised for each appcache file downloaded and I do see the console message "Offline cache update done, URL=http://example.com/browser/browser/devtools/commandline/test/browser_cmd_appcache_valid_appcache.appcache." The only problem is that the cached event is not fired.
| Assignee | ||
Comment 2•13 years ago
|
||
Is this intermittent? For me the whole site or when I leave just those two tests in the dir pass OK.
Comment 3•13 years ago
|
||
I +1 this in FF 24.0 for desktop (win). It works on FF 24.0 on Android.
| Assignee | ||
Comment 4•12 years ago
|
||
Closing based on comment 3. If this is still an issue please reopen.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Comment 5•12 years ago
|
||
This is the code I use :
//Manifest event handlers
var appCache = window.applicationCache;
appCache.addEventListener('cached', function(event) {
alert("The resources listed in the manifest have been downloaded, and the application is now cached.");
}, false);
appCache.addEventListener('updateready', function(event) {
alert("The resources listed in the manifest have been newly redownloaded, and the script can use swapCache() to switch to the new cache.");
window.applicationCache.swapCache();
}, false);
appCache.addEventListener('noupdate', function(event) {
alert("The manifest hadn't changed.");
}, false);
appCache.addEventListener('obsolete', function(event) {
alert("Unable to download the Manifest.");
}, false);
appCache.addEventListener('error', function(event) {
alert("Unable to download the Manifest.");
}, false);
When I visit my website for the first time an updateready event is fired instead of a cached event. I can reproduce this bug on Firefox 32.0.3 / Windows 7 64bits and on Firefox Mobile 32.0.3 / Android 4.4.4 / Nexus 7.
Of course, I get an error with the swapCache() probably because there is nothing to swap(InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable). If I load the website another time then a noupdate event is fired and everything works fine. It means that the manifest had been cached the first time, unfortunately no cached event is sent.
Comment 6•12 years ago
|
||
I can confirm the same issue !!!!
You need to log in
before you can comment on or make changes to this bug.
Description
•