Bug 720208 - Implement DOM4 DOMException types and codes. r=smaug,ms2ger

This commit is contained in:
Masatoshi Kimura 2012-02-23 01:34:14 +01:00
parent 0af24742c6
commit d1bbe6a3ba
17 changed files with 84 additions and 87 deletions

View File

@ -30,13 +30,13 @@ var constants = [
"INVALID_ACCESS_ERR",
"VALIDATION_ERR",
"TYPE_MISMATCH_ERR",
null,
null,
null,
null,
null,
null,
null,
"SECURITY_ERR",
"NETWORK_ERR",
"ABORT_ERR",
"URL_MISMATCH_ERR",
"QUOTA_EXCEEDED_ERR",
"TIMEOUT_ERR",
"INVALID_NODE_TYPE_ERR",
"DATA_CLONE_ERR"
];
for (var i = 0; i < constants.length; ++i) {

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=685518
SimpleTest.waitForExplicitFinish();
const SECURITY_ERR = 0x805303e8;
const SECURITY_ERR = 0x80530012;
const BAD_URI_ERR = 0x805303f4;
const OK = 0;

View File

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=682299
/** Test for Bug 682299 **/
const MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
const SECURITY_ERR = 0x805303e8;
const SECURITY_ERR = 0x80530012;
function createCanvas(width, height) {
var c = document.createElement("canvas");

View File

@ -11,7 +11,7 @@
SimpleTest.waitForExplicitFinish();
const SECURITY_ERR = 0x805303e8;
const SECURITY_ERR = 0x80530012;
const OK = 0;
var gl;

View File

@ -19702,7 +19702,7 @@ function test_bug397524() {
try {
$("canvas2").toDataURL("image/png");
gotData = true;
} catch (ex if (ex.code == 1000 && ex.name == "NS_ERROR_DOM_SECURITY_ERR")) {
} catch (ex if (ex.code == 18 && ex.name == "SecurityError")) {
}
is(gotData, false, "Shouldn't be able to read images cross-site!");
@ -19711,7 +19711,7 @@ function test_bug397524() {
try {
$("canvas3").toDataURL("image/png");
gotData = true;
} catch (ex if (ex.code == 1000 && ex.name == "NS_ERROR_DOM_SECURITY_ERR")) {
} catch (ex if (ex.code == 18 && ex.name == "SecurityError")) {
}
is(gotData, false, "Shouldn't be able to read images redirected cross-site!");

View File

@ -78,7 +78,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=415498
browser.loadURI(chromeDir + "bug415498-doc1.html");
yield;
ok(verifyErrorReceived("NS_ERROR_DOM_HIERARCHY_REQUEST_ERR"),
ok(verifyErrorReceived("HierarchyRequestError"),
"Error message not reported in event listener callback!");
gMessages = [];
@ -87,7 +87,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=415498
browser.loadURI(chromeDir + "bug415498-doc2.html");
yield;
ok(verifyErrorReceived("NS_ERROR_DOM_HIERARCHY_REQUEST_ERR"),
ok(verifyErrorReceived("HierarchyRequestError"),
"Error message not reported in window.onload!");
}

View File

@ -38,17 +38,17 @@ function afterDragTests()
checkTypes(gDataTransfer, [], 0, "after dragstart event");
expectError(function() gDataTransfer.setData("text/plain", "Some Text"),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "setData when read only");
"NoModificationAllowedError", "setData when read only");
expectError(function() gDataTransfer.clearData("text/plain"),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "clearData when read only");
"NoModificationAllowedError", "clearData when read only");
expectError(function() gDataTransfer.mozSetDataAt("text/plain", "Some Text", 0),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "setDataAt when read only");
"NoModificationAllowedError", "setDataAt when read only");
expectError(function() gDataTransfer.mozClearDataAt("text/plain", 0),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "clearDataAt when read only");
"NoModificationAllowedError", "clearDataAt when read only");
expectError(function() gDataTransfer.setDragImage(draggable, 10, 10),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "setDragImage when read only");
"NoModificationAllowedError", "setDragImage when read only");
expectError(function() gDataTransfer.addElement(draggable),
"NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR", "addElement when read only");
"NoModificationAllowedError", "addElement when read only");
var evt = document.createEvent("dragevent");
ok(evt instanceof DragEvent, "synthetic dragevent class")
@ -154,7 +154,7 @@ function test_DataTransfer(dt)
// calling setDataAt requires an index that is 0 <= index <= dt.itemCount
expectError(function() dt.mozSetDataAt("text/plain", "Some Text", 1),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "setDataAt index too high");
"IndexSizeError", "setDataAt index too high");
is(dt.mozUserCancelled, false, "userCancelled");
@ -172,9 +172,9 @@ function test_DataTransfer(dt)
// similar with clearDataAt and getDataAt
expectError(function() dt.mozGetDataAt("text/plain", 1),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "getDataAt index too high");
"IndexSizeError", "getDataAt index too high");
expectError(function() dt.mozClearDataAt("text/plain", 1),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "clearDataAt index too high");
"IndexSizeError", "clearDataAt index too high");
dt.setData("text/plain", "Sample Text");
is(dt.mozItemCount, 1, "added plaintext itemCount");
@ -285,7 +285,7 @@ function test_DataTransfer(dt)
dt.mozSetDataAt("text/plain", "First Item", 0);
dt.mozSetDataAt("text/plain", "Second Item", 1);
expectError(function() dt.mozSetDataAt("text/plain", "Some Text", 3),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "setDataAt index too high with two items");
"IndexSizeError", "setDataAt index too high with two items");
is(dt.mozItemCount, 2, "setDataAt item itemCount");
checkOneDataItem(dt, ["text/plain"], ["First Item"], 0, "setDataAt item at index 0");
checkOneDataItem(dt, ["text/plain"], ["Second Item"], 1, "setDataAt item at index 1");
@ -329,7 +329,7 @@ function test_DataTransfer(dt)
["First Item", "Changed with setData"], 0, "clearDataAt last type at index 0");
checkOneDataItem(dt, ["application/-moz-node"], [draggable], 1, "clearDataAt last type item at index 2");
expectError(function() dt.mozGetDataAt("text/plain", 2),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "getDataAt after item removed index too high");
"IndexSizeError", "getDataAt after item removed index too high");
dt.mozSetDataAt("text/unknown", "Unknown type", 2);
dt.mozSetDataAt("text/unknown", "Unknown type", 1);
@ -356,7 +356,7 @@ function test_DataTransfer(dt)
["Unknown type"], 1, "clearData type that does not exist item at index 1");
expectError(function() dt.mozClearDataAt("text/plain", 3),
"NS_ERROR_DOM_INDEX_SIZE_ERR", "clearData index too high with two items");
"IndexSizeError", "clearData index too high with two items");
// ensure that clearData() removes all data associated with the first item
dt.clearData();

View File

@ -16,7 +16,7 @@ function test(element, value, shouldThrow) {
var threw = false;
try {
element.volume = value;
} catch (err if err.name == "NS_ERROR_DOM_INDEX_SIZE_ERR") {
} catch (err if err.name == "IndexSizeError") {
threw = true;
}
is(shouldThrow, threw, "Case: " +element.id+ " setVolume=" + value);

View File

@ -43,7 +43,7 @@ const INVALID_STATE_ERR = 0x8053000b; // NS_ERROR_DOM_INVALID_STATE_ERR
const INDEX_SIZE_ERR = 0x80530001; // NS_ERROR_DOM_INDEX_SIZE_ERR
const INVALID_NODE_TYPE_ERR = 0x805c0002; // NS_ERROR_DOM_INVALID_NODE_TYPE_ERR
const NOT_OBJECT_ERR = 0x805303eb; // NS_ERROR_DOM_NOT_OBJECT_ERR
const SECURITY_ERR = 0x805303e8; // NS_ERROR_DOM_SECURITY_ERR
const SECURITY_ERR = 0x80530012; // NS_ERROR_DOM_SECURITY_ERR
/**
* Determine if the data node has only ignorable white-space.

View File

@ -38,37 +38,39 @@
/* Error Message definitions. */
/* DOM error codes from http://www.w3.org/TR/REC-DOM-Level-1/ */
/* DOM error codes from http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#domexception */
DOM_MSG_DEF(NS_ERROR_DOM_INDEX_SIZE_ERR, "Index or size is negative or greater than the allowed amount")
DOM_MSG_DEF(NS_ERROR_DOM_DOMSTRING_SIZE_ERR, "The specified range of text does not fit in a DOM string")
DOM_MSG_DEF(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR, "Node cannot be inserted at the specified point in the hierarchy")
DOM_MSG_DEF(NS_ERROR_DOM_WRONG_DOCUMENT_ERR, "Node cannot be used in a document other than the one in which it was created")
DOM_MSG_DEF(NS_ERROR_DOM_INVALID_CHARACTER_ERR, "String contains an invalid character")
DOM_MSG_DEF(NS_ERROR_DOM_NO_DATA_ALLOWED_ERR, "Node does not contain data")
DOM_MSG_DEF(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR, "Modifications are not allowed for this document")
DOM_MSG_DEF(NS_ERROR_DOM_NOT_FOUND_ERR, "Node was not found")
DOM_MSG_DEF(NS_ERROR_DOM_NOT_SUPPORTED_ERR, "Operation is not supported")
DOM_MSG_DEF(NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR, "Attribute already in use")
/* DOM error codes from http://www.w3.org/TR/DOM-Level-2/ */
DOM_MSG_DEF(NS_ERROR_DOM_INVALID_ACCESS_ERR, "A parameter or an operation is not supported by the underlying object")
DOM_MSG_DEF(NS_ERROR_DOM_INVALID_MODIFICATION_ERR, "An attempt was made to modify the type of the underlying objec")
DOM_MSG_DEF(NS_ERROR_DOM_INVALID_STATE_ERR, "An attempt was made to use an object that is not, or is no longer, usable")
DOM_MSG_DEF(NS_ERROR_DOM_NAMESPACE_ERR, "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces")
DOM_MSG_DEF(NS_ERROR_DOM_SYNTAX_ERR, "An invalid or illegal string was specified")
DOM_MSG_DEF_(INDEX_SIZE_ERR, "IndexSizeError", "Index or size is negative or greater than the allowed amount")
DOM_MSG_DEF_(DOMSTRING_SIZE_ERR, "DOMStringSizeError", "The specified range of text does not fit in a DOM string")
DOM_MSG_DEF_(HIERARCHY_REQUEST_ERR, "HierarchyRequestError", "Node cannot be inserted at the specified point in the hierarchy")
DOM_MSG_DEF_(WRONG_DOCUMENT_ERR, "WrongDocumentError", "Node cannot be used in a document other than the one in which it was created")
DOM_MSG_DEF_(INVALID_CHARACTER_ERR, "InvalidCharacterError", "String contains an invalid character")
DOM_MSG_DEF_(NO_DATA_ALLOWED_ERR, "NoDataAllowedError", "Node does not contain data")
DOM_MSG_DEF_(NO_MODIFICATION_ALLOWED_ERR, "NoModificationAllowedError", "Modifications are not allowed for this document")
DOM_MSG_DEF_(NOT_FOUND_ERR, "NotFoundError", "Node was not found")
DOM_MSG_DEF_(NOT_SUPPORTED_ERR, "NotSupportedError", "Operation is not supported")
DOM_MSG_DEF_(INUSE_ATTRIBUTE_ERR, "InUseAttributeError", "Attribute already in use")
DOM_MSG_DEF_(INVALID_STATE_ERR, "InvalidStateError", "An attempt was made to use an object that is not, or is no longer, usable")
DOM_MSG_DEF_(SYNTAX_ERR, "SyntaxError", "An invalid or illegal string was specified")
DOM_MSG_DEF_(INVALID_MODIFICATION_ERR, "InvalidModificationError", "An attempt was made to modify the type of the underlying objec")
DOM_MSG_DEF_(NAMESPACE_ERR, "NamespaceError", "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces")
DOM_MSG_DEF_(INVALID_ACCESS_ERR, "InvalidAccessError", "A parameter or an operation is not supported by the underlying object")
DOM_MSG_DEF_(VALIDATION_ERR, "ValidationError", "A call to a method would make the Node invalid with respect to \"partial validity\", so the operation was not done")
DOM_MSG_DEF_(TYPE_MISMATCH_ERR, "TypeMismatchError", "The type of an object is incompatible with the expected type of the parameter associated to the object")
DOM_MSG_DEF_(SECURITY_ERR, "SecurityError", "The operation is insecure.")
DOM_MSG_DEF_(NETWORK_ERR, "NetworkError", "A network error occurred.")
DOM_MSG_DEF_(ABORT_ERR, "AbortError", "The operation was aborted. ")
DOM_MSG_DEF_(URL_MISMATCH_ERR, "URLMismatchError", "The given URL does not match another URL.")
DOM_MSG_DEF_(QUOTA_EXCEEDED_ERR, "QuotaExceededError", "The quota has been exceeded.")
DOM_MSG_DEF_(TIMEOUT_ERR, "TimeoutError", "The operation timed out.")
DOM_MSG_DEF_(INVALID_NODE_TYPE_ERR, "InvalidNodeTypeError", "The supplied node is incorrect or has an incorrect ancestor for this operation.")
DOM_MSG_DEF_(DATA_CLONE_ERR, "DataCloneError", "The object could not be cloned.")
/* DOM error codes from http://www.w3.org/TR/DOM-Level-2/range.html */
DOM_MSG_DEF(NS_ERROR_DOM_RANGE_BAD_BOUNDARYPOINTS_ERR, "The boundary-points of a range does not meet specific requirements.")
DOM_MSG_DEF(NS_ERROR_DOM_RANGE_INVALID_NODE_TYPE_ERR, "The container of an boundary-point of a range is being set to either a node of an invalid type or a node with an ancestor of an invalid type.")
/* DOM error codes from http://www.w3.org/TR/DOM-Level-3/ */
DOM_MSG_DEF(NS_ERROR_DOM_VALIDATION_ERR, "A call to a method would make the Node invalid with respect to \"partial validity\", so the operation was not done")
DOM_MSG_DEF(NS_ERROR_DOM_TYPE_MISMATCH_ERR, "The type of an object is incompatible with the expected type of the parameter associated to the object")
/* SVG DOM error codes from http://www.w3.org/TR/SVG11/svgdom.html */
DOM_MSG_DEF(NS_ERROR_DOM_SVG_WRONG_TYPE_ERR, "Unknown or invalid type")
@ -80,10 +82,6 @@ DOM_MSG_DEF(NS_ERROR_DOM_SVG_MATRIX_NOT_INVERTABLE, "The matrix could not be com
DOM_MSG_DEF(NS_ERROR_DOM_INVALID_EXPRESSION_ERR, "The expression is not a legal expression.")
DOM_MSG_DEF(NS_ERROR_DOM_TYPE_ERR, "The expression cannot be converted to return the specified type.")
/* HTML5 error codes http://dev.w3.org/html5/spec/Overview.html */
DOM_MSG_DEF(NS_ERROR_DOM_DATA_CLONE_ERR, "The object could not be cloned.")
/* IndexedDB error codes http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html */
DOM_MSG_DEF(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR, "The operation failed for reasons unrelated to the database itself and not covered by any other error code.")
@ -105,7 +103,6 @@ DOM_MSG_DEF(NS_ERROR_DOM_INDEXEDDB_DEADLOCK_ERR, "The current transaction was au
/* DOM error codes defined by us */
/* XXX string should be specified by norris */
DOM_MSG_DEF(NS_ERROR_DOM_SECURITY_ERR, "Security error")
DOM_MSG_DEF(NS_ERROR_DOM_SECMAN_ERR, "Unable to obtain security manager")
DOM_MSG_DEF(NS_ERROR_DOM_WRONG_TYPE_ERR, "Object is of wrong type")
DOM_MSG_DEF(NS_ERROR_DOM_NOT_OBJECT_ERR, "Parameter is not an object")

View File

@ -62,15 +62,14 @@
#define NS_ERROR_DOM_INVALID_ACCESS_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,15)
#define NS_ERROR_DOM_VALIDATION_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,16)
#define NS_ERROR_DOM_TYPE_MISMATCH_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,17)
/* 18: SECURITY_ERR */
/* 19: NETWORK_ERR */
/* 20: ABORT_ERR */
/* 21: URL_MISMATCH_ERR */
/* 22: QUOTA_EXCEEDED_ERR */
/* 23: TIMEOUT_ERR */
/* 24: NOT_READABLE_ERR */
#define NS_ERROR_DOM_SECURITY_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,18)
#define NS_ERROR_DOM_NETWORK_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,19)
#define NS_ERROR_DOM_ABORT_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,20)
#define NS_ERROR_DOM_URL_MISMATCH_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,21)
#define NS_ERROR_DOM_QUOTA_EXCEEDED_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,22)
#define NS_ERROR_DOM_TIMEOUT_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,23)
#define NS_ERROR_DOM_INVALID_NODE_TYPE_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,24)
#define NS_ERROR_DOM_DATA_CLONE_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,25)
/* 26: ENCODING_ERR */
/* DOM error codes from http://www.w3.org/TR/DOM-Level-2/range.html */
@ -109,7 +108,6 @@
/* DOM error codes defined by us */
#define NS_ERROR_DOM_SECURITY_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,1000)
#define NS_ERROR_DOM_SECMAN_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,1001)
#define NS_ERROR_DOM_WRONG_TYPE_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,1002)
#define NS_ERROR_DOM_NOT_OBJECT_ERR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_DOM,1003)

View File

@ -51,6 +51,7 @@
#include "prprf.h"
#define DOM_MSG_DEF(val, message) {(val), #val, message},
#define DOM_MSG_DEF_(val, name, message) {(NS_ERROR_DOM_##val), name, message},
#define IMPL_INTERNAL_DOM_EXCEPTION_HEAD(classname, ifname) \
class classname : public nsBaseDOMException, \
@ -108,6 +109,7 @@ static struct ResultStruct
};
#undef DOM_MSG_DEF
#undef DOM_MSG_DEF_
static void
NSResultToNameAndMessage(nsresult aNSResult,
@ -157,7 +159,7 @@ IMPL_INTERNAL_DOM_EXCEPTION_TAIL(nsDOMException, nsIDOMDOMException,
NSResultToNameAndMessage)
NS_IMETHODIMP
nsDOMException::GetCode(PRUint32* aCode)
nsDOMException::GetCode(PRUint16* aCode)
{
NS_ENSURE_ARG_POINTER(aCode);
nsresult result;

View File

@ -48,38 +48,38 @@
* implementation has become unstable)
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-3-Core/
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#domexception
*/
[scriptable, uuid(a6cf910a-15b3-11d2-932e-00805f8add32)]
[scriptable, uuid(5bd766d3-57a9-4833-995d-dbe21da29595)]
interface nsIDOMDOMException : nsISupports
{
const unsigned short INDEX_SIZE_ERR = 1;
const unsigned short DOMSTRING_SIZE_ERR = 2;
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
const unsigned short HIERARCHY_REQUEST_ERR = 3;
const unsigned short WRONG_DOCUMENT_ERR = 4;
const unsigned short INVALID_CHARACTER_ERR = 5;
const unsigned short NO_DATA_ALLOWED_ERR = 6;
const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
const unsigned short NOT_FOUND_ERR = 8;
const unsigned short NOT_SUPPORTED_ERR = 9;
const unsigned short INUSE_ATTRIBUTE_ERR = 10;
// Introduced in DOM Level 2:
const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
const unsigned short INVALID_STATE_ERR = 11;
// Introduced in DOM Level 2:
const unsigned short SYNTAX_ERR = 12;
// Introduced in DOM Level 2:
const unsigned short INVALID_MODIFICATION_ERR = 13;
// Introduced in DOM Level 2:
const unsigned short NAMESPACE_ERR = 14;
// Introduced in DOM Level 2:
const unsigned short INVALID_ACCESS_ERR = 15;
// Introduced in DOM Level 3:
const unsigned short VALIDATION_ERR = 16;
// Introduced in DOM Level 3:
const unsigned short VALIDATION_ERR = 16; // historical
const unsigned short TYPE_MISMATCH_ERR = 17;
const unsigned short SECURITY_ERR = 18;
const unsigned short NETWORK_ERR = 19;
const unsigned short ABORT_ERR = 20;
const unsigned short URL_MISMATCH_ERR = 21;
const unsigned short QUOTA_EXCEEDED_ERR = 22;
const unsigned short TIMEOUT_ERR = 23;
const unsigned short INVALID_NODE_TYPE_ERR = 24;
const unsigned short DATA_CLONE_ERR = 25;
readonly attribute unsigned long code;
readonly attribute unsigned short code;
};

View File

@ -73,7 +73,7 @@ function handleCmd(evt) {
} else {
win.childWin.document.write('<script>window.parent.opener.postMessage(window.parent.testNum + " - " + window.x, "http://mochi.test:8888/"); window.parent.close();<' + '/script>');
}
} catch (e if (e.name == "NS_ERROR_DOM_SECURITY_ERR" && e.code == 1000)) {
} catch (e if (e.name == "SecurityError" && e.code == 18)) {
// Security error on cross-site write() is fine
if (win.childWin.opener == win) {
win.childWin.close();

View File

@ -18,7 +18,7 @@ try {
ok(false, "Setting localStorageItem should throw a security exception");
}
catch(ex) {
is(ex.name, "NS_ERROR_DOM_SECURITY_ERR");
is(ex.name, "SecurityError");
}
try {
@ -34,7 +34,7 @@ try {
ok(false, "Setting localStorageItem should throw a security exception");
}
catch(ex) {
is(ex.name, "NS_ERROR_DOM_SECURITY_ERR");
is(ex.name, "SecurityError");
}
try {

View File

@ -40,7 +40,7 @@ function startTest()
is(window.localStorage, null, "Storage is null");
checkException(function() {storage.setItem("test", "value");}, "NS_ERROR_DOM_SECURITY_ERR");
checkException(function() {storage.setItem("test", "value");}, "SecurityError");
setDOMStorageEnabled(true);

View File

@ -33,7 +33,7 @@
doc.open("text/html", "replace");
opened = true;
} catch (e) {
is(e.name, "NS_ERROR_DOM_SECURITY_ERR", "Unxpected exception")
is(e.name, "SecurityError", "Unxpected exception")
}
is(opened, false, "Shouldn't have opened document");
@ -41,7 +41,7 @@
doc.wrappedJSObject.open("text/html", "replace");
opened = true;
} catch (e) {
is(e.name, "NS_ERROR_DOM_SECURITY_ERR",
is(e.name, "SecurityError",
"Unxpected exception via wrappedJSObject")
}
is(opened, false, "Shouldn't have opened document via wrappedJSObject");