Bug 475116: prefix some methods removed from the application cache spec with 'moz'. r/sr/b1.9.1=jst

This commit is contained in:
Dave Camp 2009-01-25 22:50:44 -08:00
parent 17bd029bd3
commit 30bd0608c5
6 changed files with 35 additions and 35 deletions

View File

@ -40,13 +40,13 @@
interface nsIDOMDOMStringList;
[scriptable, uuid(dfcf7ad8-da0d-4e71-b36c-1780733a18e9)]
[scriptable, uuid(f394a721-66e9-46fc-bb24-b980bb732dd0)]
interface nsIDOMOfflineResourceList : nsISupports
{
/**
* Get the list of dynamically-managed entries.
*/
readonly attribute nsIDOMDOMStringList items;
readonly attribute nsIDOMDOMStringList mozItems;
/**
* Check that an entry exists in the list of dynamically-managed entries.
@ -54,21 +54,21 @@ interface nsIDOMOfflineResourceList : nsISupports
* @param uri
* The resource to check.
*/
boolean hasItem(in DOMString uri);
boolean mozHasItem(in DOMString uri);
/**
* Get the number of dynamically-managed entries.
* @status DEPRECATED
* Clients should use the "items" attribute.
*/
readonly attribute unsigned long length;
readonly attribute unsigned long mozLength;
/**
* Get the URI of a dynamically-managed entry.
* @status DEPRECATED
* Clients should use the "items" attribute.
*/
DOMString item(in unsigned long index);
DOMString mozItem(in unsigned long index);
/**
* Add an item to the list of dynamically-managed entries. The resource
@ -77,7 +77,7 @@ interface nsIDOMOfflineResourceList : nsISupports
* @param uri
* The resource to add.
*/
void add(in DOMString uri);
void mozAdd(in DOMString uri);
/**
* Remove an item from the list of dynamically-managed entries. If this
@ -87,7 +87,7 @@ interface nsIDOMOfflineResourceList : nsISupports
* @param uri
* The resource to remove.
*/
void remove(in DOMString uri);
void mozRemove(in DOMString uri);
/**
* State of the application cache this object is associated with.

View File

@ -10623,7 +10623,7 @@ nsOfflineResourceListSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
nsCOMPtr<nsIDOMOfflineResourceList> list(do_QueryInterface(aNative));
NS_ENSURE_TRUE(list, NS_ERROR_UNEXPECTED);
return list->Item(aIndex, aResult);
return list->MozItem(aIndex, aResult);
}
// nsFileListSH

View File

@ -260,7 +260,7 @@ nsDOMOfflineResourceList::Disconnect()
//
NS_IMETHODIMP
nsDOMOfflineResourceList::GetItems(nsIDOMDOMStringList **aItems)
nsDOMOfflineResourceList::GetMozItems(nsIDOMDOMStringList **aItems)
{
*aItems = nsnull;
@ -295,7 +295,7 @@ nsDOMOfflineResourceList::GetItems(nsIDOMDOMStringList **aItems)
}
NS_IMETHODIMP
nsDOMOfflineResourceList::HasItem(const nsAString& aURI, PRBool* aExists)
nsDOMOfflineResourceList::MozHasItem(const nsAString& aURI, PRBool* aExists)
{
nsresult rv = Init();
NS_ENSURE_SUCCESS(rv, rv);
@ -322,7 +322,7 @@ nsDOMOfflineResourceList::HasItem(const nsAString& aURI, PRBool* aExists)
}
NS_IMETHODIMP
nsDOMOfflineResourceList::GetLength(PRUint32 *aLength)
nsDOMOfflineResourceList::GetMozLength(PRUint32 *aLength)
{
if (!mManifestURI) {
*aLength = 0;
@ -340,7 +340,7 @@ nsDOMOfflineResourceList::GetLength(PRUint32 *aLength)
}
NS_IMETHODIMP
nsDOMOfflineResourceList::Item(PRUint32 aIndex, nsAString& aURI)
nsDOMOfflineResourceList::MozItem(PRUint32 aIndex, nsAString& aURI)
{
nsresult rv = Init();
NS_ENSURE_SUCCESS(rv, rv);
@ -359,7 +359,7 @@ nsDOMOfflineResourceList::Item(PRUint32 aIndex, nsAString& aURI)
}
NS_IMETHODIMP
nsDOMOfflineResourceList::Add(const nsAString& aURI)
nsDOMOfflineResourceList::MozAdd(const nsAString& aURI)
{
nsresult rv = Init();
NS_ENSURE_SUCCESS(rv, rv);
@ -393,7 +393,7 @@ nsDOMOfflineResourceList::Add(const nsAString& aURI)
}
PRUint32 length;
rv = GetLength(&length);
rv = GetMozLength(&length);
NS_ENSURE_SUCCESS(rv, rv);
PRUint32 maxEntries = nsContentUtils::GetIntPref(kMaxEntriesPref,
DEFAULT_MAX_ENTRIES);
@ -423,7 +423,7 @@ nsDOMOfflineResourceList::Add(const nsAString& aURI)
}
NS_IMETHODIMP
nsDOMOfflineResourceList::Remove(const nsAString& aURI)
nsDOMOfflineResourceList::MozRemove(const nsAString& aURI)
{
nsresult rv = Init();
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -22,13 +22,13 @@ function expectInvalidState(fn, desc) {
}
is(typeof(applicationCache), "object");
is(applicationCache.length, 0, "applicationCache.length should be 0");
is(applicationCache.mozLength, 0, "applicationCache.mozLength should be 0");
is(applicationCache.status, 0, "applicationCache.status should be 0 (UNCACHED)");
expectInvalidState(function() { applicationCache.add("http://localhost:8888/MochiKit/packed.js"); },
"applicationCache.add should throw INVALID_STATE_ERR");
expectInvalidState(function() { applicationCache.remove("http://localhost:8888/MochiKit/packed.js"); },
"applicationCache.remove should throw INVALID_STATE_ERR");
expectInvalidState(function() { applicationCache.mozAdd("http://localhost:8888/MochiKit/packed.js"); },
"applicationCache.mozAdd should throw INVALID_STATE_ERR");
expectInvalidState(function() { applicationCache.mozRemove("http://localhost:8888/MochiKit/packed.js"); },
"applicationCache.mozRemove should throw INVALID_STATE_ERR");
expectInvalidState(function() { applicationCache.update(); },
"applicationCache.update should throw INVALID_STATE_ERR");
expectInvalidState(function() { applicationCache.swapCache(); },

View File

@ -12,8 +12,8 @@
var gGotChecking = false;
var gGotDownloading = false;
ok(applicationCache.items.length == 0,
"applicationCache.items should be available and empty before associating with a cache.");
ok(applicationCache.mozItems.length == 0,
"applicationCache.mozItems should be available and empty before associating with a cache.");
function addFinished()
{
@ -21,28 +21,28 @@ function addFinished()
OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js",
true);
OfflineTest.ok(applicationCache.length == 1, "applicationCache should have one dynamic entry (deprecated API)");
OfflineTest.ok(applicationCache.item(0) == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.ok(applicationCache.mozLength == 1, "applicationCache should have one dynamic entry (deprecated API)");
OfflineTest.ok(applicationCache.mozItem(0) == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
"applicationCache's dynamic entry should be the one we expect (deprecated API)");
OfflineTest.ok(applicationCache.items.length == 1, "applicationCache should have one dynamic entry");
OfflineTest.ok(applicationCache.items[0] == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.ok(applicationCache.mozItems.length == 1, "applicationCache should have one dynamic entry");
OfflineTest.ok(applicationCache.mozItems[0] == "http://localhost:8888/tests/SimpleTest/EventUtils.js",
"applicationCache's dynamic entry should be the one we expect");
OfflineTest.ok(applicationCache.hasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
"applicationCache.hasItem() should see the dynamic entry");
OfflineTest.ok(applicationCache.mozHasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
"applicationCache.mozHasItem() should see the dynamic entry");
// Now test that removes work
applicationCache.remove("http://localhost:8888/tests/SimpleTest/EventUtils.js");
applicationCache.mozRemove("http://localhost:8888/tests/SimpleTest/EventUtils.js");
OfflineTest.checkCache("http://localhost:8888/tests/SimpleTest/EventUtils.js",
false);
OfflineTest.ok(applicationCache.length == 0,
OfflineTest.ok(applicationCache.mozLength == 0,
"applicationCache should have no dynamic entries (deprecated API)");
OfflineTest.ok(applicationCache.items.length == 0,
OfflineTest.ok(applicationCache.mozItems.length == 0,
"applicationCache should have no dynamic entries");
OfflineTest.ok(!applicationCache.hasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
"applicationCache.hasItem() should not see the removed dynamic entry");
OfflineTest.ok(!applicationCache.mozHasItem("http://localhost:8888/tests/SimpleTest/EventUtils.js"),
"applicationCache.mozHasItem() should not see the removed dynamic entry");
// We're done
@ -83,7 +83,7 @@ function manifestUpdated()
// XXX: make sure that the previous version went away after the swapCache().
// Now add a file using the applicationCache API
applicationCache.add("http://localhost:8888/tests/SimpleTest/EventUtils.js");
applicationCache.mozAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js");
// Wait for the add() to be downloaded
OfflineTest.waitForAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js",

View File

@ -159,7 +159,7 @@ function manifestCached()
function fallbackLoaded()
{
applicationCache.add("http://localhost:8888/tests/SimpleTest/EventUtils.js");
applicationCache.mozAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js");
OfflineTest.waitForAdd("http://localhost:8888/tests/SimpleTest/EventUtils.js",
dynamicLoaded);
}