mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 771401 - Change PRTime in IDL to signed long long. r=bholley sr=bsmedberg
This commit is contained in:
parent
ab782c26b2
commit
bc868ccf9a
@ -17,7 +17,10 @@ TestObjectReadWrite.prototype = {
|
||||
shortProperty: 32767,
|
||||
longProperty: 2147483647,
|
||||
floatProperty: 5.5,
|
||||
charProperty: "X"
|
||||
charProperty: "X",
|
||||
// timeProperty is PRTime and signed type.
|
||||
// So it has to allow negative value.
|
||||
timeProperty: -1
|
||||
};
|
||||
|
||||
|
||||
@ -35,7 +38,10 @@ TestObjectReadOnly.prototype = {
|
||||
shortReadOnly: 32767,
|
||||
longReadOnly: 2147483647,
|
||||
floatReadOnly: 5.5,
|
||||
charReadOnly: "X"
|
||||
charReadOnly: "X",
|
||||
// timeProperty is PRTime and signed type.
|
||||
// So it has to allow negative value.
|
||||
timeReadOnly: -1
|
||||
};
|
||||
|
||||
|
||||
|
@ -14,6 +14,9 @@ xpcTestObjectReadOnly :: xpcTestObjectReadOnly() {
|
||||
longProperty = 2147483647;
|
||||
floatProperty = 5.5f;
|
||||
charProperty = 'X';
|
||||
// timeProperty is PRTime and signed type.
|
||||
// So it has to allow negative value.
|
||||
timeProperty = -1;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP xpcTestObjectReadOnly :: GetStrReadOnly(char * *aStrReadOnly){
|
||||
@ -46,6 +49,10 @@ NS_IMETHODIMP xpcTestObjectReadOnly :: GetCharReadOnly(char *aCharReadOnly){
|
||||
*aCharReadOnly = charProperty;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP xpcTestObjectReadOnly :: GetTimeReadOnly(PRTime *aTimeReadOnly){
|
||||
*aTimeReadOnly = timeProperty;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(xpcTestObjectReadWrite, nsIXPCTestObjectReadWrite)
|
||||
|
||||
@ -57,6 +64,9 @@ xpcTestObjectReadWrite :: xpcTestObjectReadWrite() {
|
||||
longProperty = 2147483647;
|
||||
floatProperty = 5.5f;
|
||||
charProperty = 'X';
|
||||
// timeProperty is PRTime and signed type.
|
||||
// So it has to allow negative value.
|
||||
timeProperty = -1;
|
||||
}
|
||||
|
||||
xpcTestObjectReadWrite :: ~xpcTestObjectReadWrite()
|
||||
@ -119,3 +129,11 @@ NS_IMETHODIMP xpcTestObjectReadWrite :: SetCharProperty(char aCharProperty) {
|
||||
charProperty = aCharProperty;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP xpcTestObjectReadWrite :: GetTimeProperty(PRTime *aTimeProperty) {
|
||||
*aTimeProperty = timeProperty;
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP xpcTestObjectReadWrite :: SetTimeProperty(PRTime aTimeProperty) {
|
||||
timeProperty = aTimeProperty;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ class xpcTestObjectReadOnly MOZ_FINAL : public nsIXPCTestObjectReadOnly {
|
||||
PRInt32 longProperty;
|
||||
float floatProperty;
|
||||
char charProperty;
|
||||
PRTime timeProperty;
|
||||
};
|
||||
|
||||
class xpcTestObjectReadWrite MOZ_FINAL : public nsIXPCTestObjectReadWrite {
|
||||
@ -46,6 +47,7 @@ class xpcTestObjectReadWrite MOZ_FINAL : public nsIXPCTestObjectReadWrite {
|
||||
float floatProperty;
|
||||
char charProperty;
|
||||
char *stringProperty;
|
||||
PRTime timeProperty;
|
||||
};
|
||||
|
||||
class nsXPCTestParams MOZ_FINAL : public nsIXPCTestParams
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
[scriptable, uuid(29e950a0-0134-44bc-b947-5e0ee95c8f7e)]
|
||||
[scriptable, uuid(42fbd9f6-b12d-47ef-b7a1-02d73c11fe53)]
|
||||
interface nsIXPCTestObjectReadOnly : nsISupports {
|
||||
readonly attribute string strReadOnly;
|
||||
readonly attribute boolean boolReadOnly;
|
||||
@ -18,9 +18,10 @@ interface nsIXPCTestObjectReadOnly : nsISupports {
|
||||
readonly attribute long longReadOnly;
|
||||
readonly attribute float floatReadOnly;
|
||||
readonly attribute char charReadOnly;
|
||||
readonly attribute PRTime timeReadOnly;
|
||||
};
|
||||
|
||||
[scriptable, uuid(492609a7-2582-436b-b0ef-92e29bb9e143)]
|
||||
[scriptable, uuid(f07529b0-a479-4954-aba5-ab3142c6b1cb)]
|
||||
interface nsIXPCTestObjectReadWrite : nsISupports {
|
||||
attribute string stringProperty;
|
||||
attribute boolean booleanProperty;
|
||||
@ -28,4 +29,5 @@ interface nsIXPCTestObjectReadWrite : nsISupports {
|
||||
attribute long longProperty;
|
||||
attribute float floatProperty;
|
||||
attribute char charProperty;
|
||||
attribute PRTime timeProperty;
|
||||
};
|
||||
|
@ -30,6 +30,7 @@ function test_component_readwrite(contractid) {
|
||||
do_check_eq(2147483647, o.longProperty);
|
||||
do_check_true(5.25 < o.floatProperty && 5.75 > o.floatProperty);
|
||||
do_check_eq("X", o.charProperty);
|
||||
do_check_eq(-1, o.timeProperty);
|
||||
|
||||
// Write new values.
|
||||
o.stringProperty = "another string";
|
||||
@ -38,6 +39,7 @@ function test_component_readwrite(contractid) {
|
||||
o.longProperty = 1234567890;
|
||||
o.floatProperty = 10.2;
|
||||
o.charProperty = "Z";
|
||||
o.timeProperty = 1;
|
||||
|
||||
// Test the new values.
|
||||
do_check_eq("another string", o.stringProperty);
|
||||
@ -46,6 +48,7 @@ function test_component_readwrite(contractid) {
|
||||
do_check_eq(1234567890, o.longProperty);
|
||||
do_check_true(10.15 < o.floatProperty && 10.25 > o.floatProperty);
|
||||
do_check_eq("Z", o.charProperty);
|
||||
do_check_eq(1, o.timeProperty);
|
||||
|
||||
// Assign values that differ from the expected type to verify conversion.
|
||||
|
||||
@ -74,4 +77,5 @@ function test_component_readonly(contractid) {
|
||||
do_check_eq(2147483647, o.longReadOnly);
|
||||
do_check_true(5.25 < o.floatReadOnly && 5.75 > o.floatReadOnly);
|
||||
do_check_eq("X", o.charReadOnly);
|
||||
do_check_eq(-1, o.timeReadOnly);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ typedef unsigned short PRUint16 ;
|
||||
typedef unsigned short PRUnichar;
|
||||
typedef unsigned long PRUint32 ;
|
||||
typedef unsigned long long PRUint64 ;
|
||||
typedef unsigned long long PRTime ;
|
||||
typedef long long PRTime ;
|
||||
typedef short PRInt16 ;
|
||||
typedef long PRInt32 ;
|
||||
typedef long long PRInt64 ;
|
||||
|
Loading…
Reference in New Issue
Block a user