/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var ObjectReadWrite = {
QueryInterface: ChromeUtils.generateQI(["nsIXPCTestObjectReadWrite"]),
/* nsIXPCTestObjectReadWrite */
stringProperty: "XPConnect Read-Writable String",
booleanProperty: true,
shortProperty: 32767,
longProperty: 2147483647,
floatProperty: 5.5,
charProperty: "X", // timeProperty is PRTime and signed type. // So it has to allow negative value.
timeProperty: -1,
};
var ObjectReadOnly = {
QueryInterface: ChromeUtils.generateQI(["nsIXPCTestObjectReadOnly"]),
/* nsIXPCTestObjectReadOnly */
strReadOnly: "XPConnect Read-Only String",
boolReadOnly: true,
shortReadOnly: 32767,
longReadOnly: 2147483647,
floatReadOnly: 5.5,
charReadOnly: "X", // timeProperty is PRTime and signed type. // So it has to allow negative value.
timeReadOnly: -1,
};
function run_test() { // Load the component manifests.
registerXPCTestComponents();
// Test for each component.
test_component_readwrite(Cc["@mozilla.org/js/xpc/test/native/ObjectReadWrite;1"].createInstance());
test_component_readwrite(xpcWrap(ObjectReadWrite));
test_component_readonly(Cc["@mozilla.org/js/xpc/test/native/ObjectReadOnly;1"].createInstance());
test_component_readonly(xpcWrap(ObjectReadOnly));
}
function test_component_readwrite(obj) { // Instantiate the object. var o = obj.QueryInterface(Ci.nsIXPCTestObjectReadWrite);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.