Bug 677864: fixes components members class description; r=mrbkap
authorarno renevier <arno@renevier.net>
Fri, 19 Aug 2011 15:27:43 -0400
changeset 75578 77704e4f395bc71b92bb0cc4a1a45e42d208e9ee
parent 75577 427f162c761c195d919f3a593c82bea0e4851ccf
child 75579 1d2621d8b9634dfd9c86b9286d792ecf6518c689
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmrbkap
bugs677864
milestone9.0a1
Bug 677864: fixes components members class description; r=mrbkap
js/src/xpconnect/src/xpccomponents.cpp
js/src/xpconnect/tests/unit/test_bug677864.js
js/src/xpconnect/tests/unit/xpcshell.ini
--- a/js/src/xpconnect/src/xpccomponents.cpp
+++ b/js/src/xpconnect/src/xpccomponents.cpp
@@ -498,17 +498,17 @@ nsXPCComponents_InterfacesByID::GetContr
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP
 nsXPCComponents_InterfacesByID::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_InterfacesByID";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP
 nsXPCComponents_InterfacesByID::GetClassID(nsCID * *aClassID)
 {
@@ -1070,17 +1070,17 @@ nsXPCComponents_ClassesByID::GetContract
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCComponents_ClassesByID::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_ClassesByID";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCComponents_ClassesByID::GetClassID(nsCID * *aClassID)
 {
@@ -1341,17 +1341,17 @@ nsXPCComponents_Results::GetContractID(c
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCComponents_Results::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_Results";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCComponents_Results::GetClassID(nsCID * *aClassID)
 {
@@ -1570,17 +1570,17 @@ nsXPCComponents_ID::GetContractID(char *
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCComponents_ID::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_ID";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCComponents_ID::GetClassID(nsCID * *aClassID)
 {
@@ -1798,17 +1798,17 @@ nsXPCComponents_Exception::GetContractID
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCComponents_Exception::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_Exception";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCComponents_Exception::GetClassID(nsCID * *aClassID)
 {
@@ -2093,17 +2093,17 @@ nsXPCConstructor::GetContractID(char * *
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCConstructor::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCConstructor";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCConstructor::GetClassID(nsCID * *aClassID)
 {
@@ -2359,17 +2359,17 @@ nsXPCComponents_Constructor::GetContract
     *aContractID = nsnull;
     return NS_ERROR_NOT_AVAILABLE;
 }
 
 /* readonly attribute string classDescription; */
 NS_IMETHODIMP 
 nsXPCComponents_Constructor::GetClassDescription(char * *aClassDescription)
 {
-    static const char classDescription[] = "XPCComponents_Interfaces";
+    static const char classDescription[] = "XPCComponents_Constructor";
     *aClassDescription = (char*)nsMemory::Clone(classDescription, sizeof(classDescription));
     return *aClassDescription ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* readonly attribute nsCIDPtr classID; */
 NS_IMETHODIMP 
 nsXPCComponents_Constructor::GetClassID(nsCID * *aClassID)
 {
new file mode 100644
--- /dev/null
+++ b/js/src/xpconnect/tests/unit/test_bug677864.js
@@ -0,0 +1,12 @@
+function check_cl(iface, desc) {
+    do_check_eq(iface.QueryInterface(Components.interfaces.nsIClassInfo).classDescription, desc);
+}
+
+function run_test() {
+    check_cl(Components, 'XPCComponents');
+    check_cl(Components.interfaces, 'XPCComponents_Interfaces');
+    check_cl(Components.interfacesByID, 'XPCComponents_InterfacesByID');
+    check_cl(Components.classes, 'XPCComponents_Classes');
+    check_cl(Components.classesByID, 'XPCComponents_ClassesByID');
+    check_cl(Components.results, 'XPCComponents_Results');
+}
--- a/js/src/xpconnect/tests/unit/xpcshell.ini
+++ b/js/src/xpconnect/tests/unit/xpcshell.ini
@@ -4,16 +4,17 @@ tail =
 
 [test_bogus_files.js]
 [test_bug408412.js]
 [test_bug451678.js]
 [test_bug596580.js]
 [test_bug604362.js]
 [test_bug608142.js]
 [test_bug641378.js]
+[test_bug677864.js]
 [test_bug_442086.js]
 [test_file.js]
 [test_import.js]
 [test_js_weak_references.js]
 [test_localeCompare.js]
 [test_recursive_import.js]
 [test_xpcomutils.js]
 [test_unload.js]