зеркало из https://github.com/mozilla/pjs.git
Bug 492219. Rename globalStorage constructor to StorageObsolete and localStorage constuctor to Storage. r+sr=jst
This commit is contained in:
Родитель
1efad9eaf2
Коммит
ffaa9a6009
|
@ -1182,7 +1182,7 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
// since a call to addProperty() is always followed by a call to
|
||||
// setProperty(), except in the case when a getter or setter is set
|
||||
// for a property. But we don't care about getters or setters here.
|
||||
NS_DEFINE_CLASSINFO_DATA(Storage, nsStorageSH,
|
||||
NS_DEFINE_CLASSINFO_DATA(StorageObsolete, nsStorageSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_NEWRESOLVE |
|
||||
nsIXPCScriptable::WANT_GETPROPERTY |
|
||||
|
@ -1191,7 +1191,7 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
|||
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |
|
||||
nsIXPCScriptable::WANT_NEWENUMERATE)
|
||||
|
||||
NS_DEFINE_CLASSINFO_DATA(Storage2, nsStorage2SH,
|
||||
NS_DEFINE_CLASSINFO_DATA(Storage, nsStorage2SH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_NEWRESOLVE |
|
||||
nsIXPCScriptable::WANT_GETPROPERTY |
|
||||
|
@ -3396,11 +3396,11 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathResult)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(Storage, nsIDOMStorage)
|
||||
DOM_CLASSINFO_MAP_BEGIN(StorageObsolete, nsIDOMStorage)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(Storage2, nsIDOMStorage2)
|
||||
DOM_CLASSINFO_MAP_BEGIN(Storage, nsIDOMStorage2)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage2)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
|
|
|
@ -382,8 +382,8 @@ enum nsDOMClassInfoID {
|
|||
eDOMClassInfo_XPathResult_id,
|
||||
|
||||
// WhatWG WebApps Objects
|
||||
eDOMClassInfo_StorageObsolete_id,
|
||||
eDOMClassInfo_Storage_id,
|
||||
eDOMClassInfo_Storage2_id,
|
||||
eDOMClassInfo_StorageList_id,
|
||||
eDOMClassInfo_StorageItem_id,
|
||||
eDOMClassInfo_StorageEvent_id,
|
||||
|
|
|
@ -471,7 +471,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStorage)
|
|||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorage)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorage)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMStorage)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Storage)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(StorageObsolete)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -1342,7 +1342,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMStorage2)
|
|||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStorage2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorage2)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMStorage)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Storage2)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Storage)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -9,10 +9,10 @@ function test_DOMStorage_global()
|
|||
is(globalStorage instanceof StorageList, true, "globalStorage property");
|
||||
|
||||
var storage = globalStorage.namedItem(currentDomain);
|
||||
is(storage instanceof Storage, true, "StorageList namedItem");
|
||||
is(storage instanceof StorageObsolete, true, "StorageList namedItem");
|
||||
|
||||
var storage2 = globalStorage[currentDomain];
|
||||
is(storage2 instanceof Storage, true, "StorageList property syntax");
|
||||
is(storage2 instanceof StorageObsolete, true, "StorageList property syntax");
|
||||
|
||||
is(storage, storage2, "StorageList namedItem and array return same value");
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ _TEST_FILES = \
|
|||
test_localStorageQuota.html \
|
||||
test_localStorageKeyOrder.html \
|
||||
test_removeOwnersAPI.html \
|
||||
test_storageConstructor.html \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_FILES = \
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>localStorage different port numbers</title>
|
||||
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="interOriginTest2.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function startTest()
|
||||
{
|
||||
var functionCalled = false;
|
||||
is(localStorage instanceof Storage, true, "localStorage is instance of Storage");
|
||||
Storage.prototype.exists = function(key) {
|
||||
functionCalled = true;
|
||||
return this.getItem(key) != null;
|
||||
}
|
||||
localStorage.setItem("test_prototype", "value");
|
||||
is(functionCalled, false, "Overridden function not called");
|
||||
is(localStorage.exists("test_prototype"), true, "Prototype overridden");
|
||||
is(functionCalled, true, "Overridden function called");
|
||||
localStorage.clear();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="startTest();">
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче