Bug 1024635 - Add 'network' contract ID alias for the new cache service, r=bz

This commit is contained in:
Honza Bambas 2014-06-13 01:45:43 +02:00
parent a0e460baf1
commit a3e715ae45
4 changed files with 21 additions and 0 deletions

View File

@ -1111,6 +1111,7 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
{ NS_REDIRECTCHANNELREGISTRAR_CONTRACTID, &kNS_REDIRECTCHANNELREGISTRAR_CID },
{ NS_CACHE_STORAGE_SERVICE_CONTRACTID, &kNS_CACHE_STORAGE_SERVICE_CID },
{ NS_CACHE_STORAGE_SERVICE_CONTRACTID2, &kNS_CACHE_STORAGE_SERVICE_CID },
{ NS_NETWORKPREDICTOR_CONTRACTID, &kNS_NETWORKPREDICTOR_CID },
{ nullptr }
};

View File

@ -342,4 +342,7 @@ void ProxyReleaseMainThread(nsCOMPtr<T> &object)
#define NS_CACHE_STORAGE_SERVICE_CONTRACTID \
"@mozilla.org/netwerk/cache-storage-service;1"
#define NS_CACHE_STORAGE_SERVICE_CONTRACTID2 \
"@mozilla.org/network/cache-storage-service;1"
#endif

View File

@ -0,0 +1,16 @@
function run_test()
{
// Just check the contract ID alias works well.
try {
var serviceA = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Components.interfaces.nsICacheStorageService);
do_check_true(serviceA);
var serviceB = Components.classes["@mozilla.org/network/cache-storage-service;1"]
.getService(Components.interfaces.nsICacheStorageService);
do_check_true(serviceB);
do_check_eq(serviceA, serviceB);
} catch (ex) {
do_throw("Cannot instantiate cache storage service: " + ex);
}
}

View File

@ -19,6 +19,7 @@ support-files =
test_link.url
[test_nsIBufferedOutputStream_writeFrom_block.js]
[test_cache2-00-service-get.js]
[test_cache2-01-basic.js]
[test_cache2-01a-basic-readonly.js]
[test_cache2-01b-basic-datasize.js]