Backed out changeset 7db605793963 (bug 1407719) for causing xpcshell test failures. a=jorgk
authorJorg K <jorgk@jorgk.com>
Wed, 18 Oct 2017 20:05:47 +0200
changeset 29208 ef6dca7cc6cd3ee6c718489be624c606597b34df
parent 29207 7db605793963fa0ff7beeb68cc0ed3f75f7845e2
child 29209 8cd587465eab8d99bbd718431f37dd1acd1f44a1
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1407719
backs out7db605793963fa0ff7beeb68cc0ed3f75f7845e2
Backed out changeset 7db605793963 (bug 1407719) for causing xpcshell test failures. a=jorgk
chat/components/src/imContacts.js
chat/modules/imSmileys.jsm
chat/modules/test/test_filtering.js
chat/protocols/xmpp/xmpp-session.jsm
--- a/chat/components/src/imContacts.js
+++ b/chat/components/src/imContacts.js
@@ -91,39 +91,37 @@ function getDBConnection()
 
   return conn;
 }
 
 // Wrap all the usage of DBConn inside a transaction that will be
 // commited automatically at the end of the event loop spin so that
 // we flush buddy list data to disk only once per event loop spin.
 var gDBConnWithPendingTransaction = null;
-Object.defineProperty(this, "DBConn", {
-  get: function() {
-    if (gDBConnWithPendingTransaction)
-      return gDBConnWithPendingTransaction;
+this.__defineGetter__("DBConn", function() {
+  if (gDBConnWithPendingTransaction)
+    return gDBConnWithPendingTransaction;
 
-    if (!gDBConnection) {
-      gDBConnection = getDBConnection();
-      Services.obs.addObserver(function dbClose(aSubject, aTopic, aData) {
-        Services.obs.removeObserver(dbClose, aTopic);
-        if (gDBConnection) {
-          gDBConnection.asyncClose();
-          gDBConnection = null;
-        }
-      }, "profile-before-change", false);
-    }
-    gDBConnWithPendingTransaction = gDBConnection;
-    gDBConnection.beginTransaction();
-    executeSoon(function() {
-      gDBConnWithPendingTransaction.commitTransaction();
-      gDBConnWithPendingTransaction = null;
-    });
-    return gDBConnection;
+  if (!gDBConnection) {
+    gDBConnection = getDBConnection();
+    Services.obs.addObserver(function dbClose(aSubject, aTopic, aData) {
+      Services.obs.removeObserver(dbClose, aTopic);
+      if (gDBConnection) {
+        gDBConnection.asyncClose();
+        gDBConnection = null;
+      }
+    }, "profile-before-change", false);
   }
+  gDBConnWithPendingTransaction = gDBConnection;
+  gDBConnection.beginTransaction();
+  executeSoon(function() {
+    gDBConnWithPendingTransaction.commitTransaction();
+    gDBConnWithPendingTransaction = null;
+  });
+  return gDBConnection;
 });
 
 function TagsService() { }
 TagsService.prototype = {
   get wrappedJSObject() { return this; },
   get defaultTag() { return this.createTag(_("defaultGroup")); },
   createTag: function(aName) {
     // If the tag already exists, we don't want to create a duplicate.
--- a/chat/modules/imSmileys.jsm
+++ b/chat/modules/imSmileys.jsm
@@ -10,22 +10,20 @@ this.EXPORTED_SYMBOLS = [
   "smileString", // used to add smile:// img tags into a string without parsing it as HTML. Be sure the string doesn't contain HTML tags.
   "getSmileRealURI", // used to retrive the chrome URI for a smile:// URI
   "getSmileyList" // used to display a list of smileys in the UI
 ];
 
 var kEmoticonsThemePref = "messenger.options.emoticonsTheme";
 var kThemeFile = "theme.js";
 
-Object.defineProperty(this, "gTheme", {
-  get: function() {
-    delete this.gTheme;
-    gPrefObserver.init();
-    return this.gTheme = getTheme();
-  }
+this.__defineGetter__("gTheme", function() {
+  delete this.gTheme;
+  gPrefObserver.init();
+  return this.gTheme = getTheme();
 });
 
 var gPrefObserver = {
   init: function po_init() {
     Services.prefs.addObserver(kEmoticonsThemePref, gPrefObserver, false);
   },
 
   observe: function so_observe(aObject, aTopic, aMsg) {
--- a/chat/modules/test/test_filtering.js
+++ b/chat/modules/test/test_filtering.js
@@ -214,18 +214,18 @@ function test_permissiveMode() {
     "font-size: larger"
   ];
   for (let css of okCSS) {
     let string = "<span style=\"" + css + "\">foo</span>";
     do_check_eq(string, cleanupImMarkup(string));
   }
   // The shorthand 'font' is decomposed to non-shorthand properties,
   // and not recomposed as some non-shorthand properties are filtered out.
-  do_check_eq("<span style=\"font-style: normal; font-weight: normal;" +
-              " font-size: 15px; font-family: normal;\">foo</span>",
+  do_check_eq("<span style=\"font-family: normal; font-style: normal;" +
+              " font-weight: normal; font-size: 15px;\">foo</span>",
               cleanupImMarkup("<span style=\"font: 15px normal\">foo</span>"));
 
   // But still filter out dangerous CSS rules.
   const badCSS = [
     "-moz-binding: url('chrome://global/content/bindings/textbox.xml#textbox');",
     "display: none",
     "visibility: hidden"
   ];
--- a/chat/protocols/xmpp/xmpp-session.jsm
+++ b/chat/protocols/xmpp/xmpp-session.jsm
@@ -16,19 +16,17 @@ Cu.import("resource:///modules/xmpp-auth
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/xmpp.properties")
 );
 
 // Workaround because a lazy getter can't be exported.
 XPCOMUtils.defineLazyGetter(this, "_defaultResource", () =>
   l10nHelper("chrome://branding/locale/brand.properties")("brandShortName")
 );
-Object.defineProperty(this, "XMPPDefaultResource", {
-  get: () => _defaultResource
-});
+this.__defineGetter__("XMPPDefaultResource", () => _defaultResource);
 
 function XMPPSession(aHost, aPort, aSecurity, aJID, aPassword, aAccount) {
   this._host = aHost;
   this._port = aPort;
 
   this._connectionSecurity = aSecurity;
   if (this._connectionSecurity == "old_ssl")
     this._security = ["ssl"];