Bug 956857 - Fix busted semantics for subject parameter in "xpcom-category-entry-removed" notification. r=bsmedberg
authorProjjol Banerji <probaner23@gmail.com>
Wed, 29 Jan 2014 17:07:35 -0500
changeset 181893 732dba2ce115c17ddc7469ef9951e0c9a630f6f4
parent 181892 a0ca4f9987ab84c290d409ced6322891b100c5c7
child 181894 5b1a561bd89e7e5249c3235c62982b754dbe6471
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs956857
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 956857 - Fix busted semantics for subject parameter in "xpcom-category-entry-removed" notification. r=bsmedberg
xpcom/components/nsCategoryManager.cpp
xpcom/tests/unit/test_bug374754.js
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -654,17 +654,17 @@ nsCategoryManager::AddCategoryEntry(cons
                                   aValue,
                                   aReplace,
                                   &oldEntry,
                                   &mArena);
 
   if (NS_SUCCEEDED(rv)) {
     if (oldEntry) {
       NotifyObservers(NS_XPCOM_CATEGORY_ENTRY_REMOVED_OBSERVER_ID,
-                      aCategoryName, oldEntry);
+                      aCategoryName, aEntryName);
     }
     NotifyObservers(NS_XPCOM_CATEGORY_ENTRY_ADDED_OBSERVER_ID,
                     aCategoryName, aEntryName);
 
     if (aOldValue)
       *aOldValue = oldEntry;
     else
       NS_Free(oldEntry);
--- a/xpcom/tests/unit/test_bug374754.js
+++ b/xpcom/tests/unit/test_bug374754.js
@@ -1,16 +1,17 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 var addedTopic = "xpcom-category-entry-added";
 var removedTopic = "xpcom-category-entry-removed";
 var testCategory = "bug-test-category";
 var testEntry = "@mozilla.org/bug-test-entry;1";
 
+var testValue= "check validity";
 var result = "";
 var expected = "add remove add remove ";
 var timer;
 
 var observer = {
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsISupports) || iid.equals(Ci.nsIObserver))
       return this;
@@ -44,15 +45,15 @@ var observer = {
 function run_test() {
   do_test_pending();
 
   var observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
   observerService.addObserver(observer, addedTopic, false);
   observerService.addObserver(observer, removedTopic, false);
 
   var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
-  categoryManager.addCategoryEntry(testCategory, testEntry, testEntry, false, true);
-  categoryManager.addCategoryEntry(testCategory, testEntry, testEntry, false, true);
+  categoryManager.addCategoryEntry(testCategory, testEntry, testValue, false, true);
+  categoryManager.addCategoryEntry(testCategory, testEntry, testValue, false, true);
   categoryManager.deleteCategoryEntry(testCategory, testEntry, false);
 
   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   timer.init(observer, 0, timer.TYPE_ONE_SHOT);
 }