Backed out changeset 3cb69bac2eac (bug 1417577) at eoger's request.
authorBrindusan Cristian <cbrindusan@mozilla.com>
Wed, 30 May 2018 01:39:37 +0300
changeset 474557 2d5ae6823a39da1b24019e167f4c402ef684b5b8
parent 474556 938be426f7d9d298c9a569c51a56448b72eae04b
child 474558 2c0e0933f95944c2aee40286f3e1b182d2e37c38
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1417577
milestone62.0a1
backs out3cb69bac2eac6758496c4584412274b44da0f557
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
Backed out changeset 3cb69bac2eac (bug 1417577) at eoger's request.
browser/components/syncedtabs/SyncedTabsDeckComponent.js
browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
--- a/browser/components/syncedtabs/SyncedTabsDeckComponent.js
+++ b/browser/components/syncedtabs/SyncedTabsDeckComponent.js
@@ -74,22 +74,16 @@ SyncedTabsDeckComponent.prototype = {
     Services.obs.addObserver(this, FxAccountsCommon.ONLOGIN_NOTIFICATION);
     Services.obs.addObserver(this, "weave:service:login:change");
     // If the Sync service is not ready, in init() > updatePanel() we will
     // show a blank screen. If tab syncing is disabled, we will not get any other
     // ui-refreshing notifications! We listen to :ready in order to check again
     // if this engine is disabled and refresh the UI one last time.
     Services.obs.addObserver(this, "weave:service:ready");
 
-    // Add intl.uidirection support for HTML sidebar
-    XPCOMUtils.defineLazyPreferenceGetter(this, "dirPref", "intl.uidirection", -1,
-      (pref, oldVal, newVal) => { this.updateDir(newVal); }
-    );
-    this.updateDir();
-
     // Go ahead and trigger sync
     this._SyncedTabs.syncTabs()
                     .catch(Cu.reportError);
 
     this._deckView = new this._DeckView(this._window, this.tabListComponent, {
       onConnectDeviceClick: event => this.openConnectDevice(event),
       onSyncPrefClick: event => this.openSyncPrefs(event)
     });
@@ -118,21 +112,16 @@ SyncedTabsDeckComponent.prototype = {
         break;
       case "weave:service:ready":
         Services.obs.removeObserver(this, "weave:service:ready");
         // Intended fallthrough.
       case FxAccountsCommon.ONLOGIN_NOTIFICATION:
       case "weave:service:login:change":
         this.updatePanel();
         break;
-      case "nsPref:changed":
-        if (data == "intl.uidirection") {
-          this.updateDir();
-        }
-        break;
       default:
         break;
     }
   },
 
   // There's no good way to mock fxAccounts in browser tests where it's already
   // been instantiated, so we have this method for stubbing.
   _getSignedInUser() {
@@ -164,31 +153,16 @@ SyncedTabsDeckComponent.prototype = {
       });
     })
     .catch(err => {
       Cu.reportError(err);
       return this.PANELS.NOT_AUTHED_INFO;
     });
   },
 
-  updateDir(pref) {
-    console.log("Called updateDir lmao");
-    console.log(`called pref: <${pref}>, config pref: <${this.dirPref}>`);
-    pref = pref || this.dirPref;
-
-    // If the HTML document doesn't exist, we can't update the window
-    if (!this._window.document) return;
-
-    if (pref > 0 || (pref < 0 && Services.locale.isAppLocaleRTL)) {
-      this._window.document.body.dir = "rtl";
-    } else {
-      this._window.document.body.dir = "ltr";
-    }
-  },
-
   updatePanel() {
     // return promise for tests
     return this.getPanelStatus()
       .then(panelId => this._deckStore.selectPanel(panelId))
       .catch(Cu.reportError);
   },
 
   openSyncPrefs() {
--- a/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
+++ b/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
@@ -89,32 +89,30 @@ add_task(async function testObserver() {
   sinon.stub(SyncedTabs, "syncTabs", () => Promise.resolve());
 
   sinon.spy(deckStore, "on");
   sinon.stub(deckStore, "setPanels");
 
   sinon.stub(listStore, "getData");
 
   let component = new SyncedTabsDeckComponent({
-    window: mockWindow,
+    mockWindow,
     deckStore,
     listStore,
     listComponent,
     SyncedTabs,
     DeckView: ViewMock,
   });
 
   sinon.spy(component, "observe");
   sinon.stub(component, "updatePanel");
-  sinon.spy(component, "updateDir");
 
   component.init();
   SyncedTabs.syncTabs.restore();
   Assert.ok(component.updatePanel.called, "triggers panel update during init");
-  Assert.ok(component.updateDir.called, "triggers UI direction update during init");
 
   Services.obs.notifyObservers(null, SyncedTabs.TOPIC_TABS_CHANGED);
 
   Assert.ok(component.observe.calledWith(null, SyncedTabs.TOPIC_TABS_CHANGED),
     "component is notified");
 
   Assert.ok(listStore.getData.called, "gets list data");
   Assert.ok(component.updatePanel.calledTwice, "triggers panel update");
@@ -125,21 +123,16 @@ add_task(async function testObserver() {
     "component is notified of login");
   Assert.equal(component.updatePanel.callCount, 3, "triggers panel update again");
 
   Services.obs.notifyObservers(null, "weave:service:login:change");
 
   Assert.ok(component.observe.calledWith(null, "weave:service:login:change"),
     "component is notified of login change");
   Assert.equal(component.updatePanel.callCount, 4, "triggers panel update again");
-
-  Services.prefs.setIntPref("intl.uidirection", 1);
-
-  Assert.ok(component.updateDir.calledTwice, "triggers UI direction update");
-  Assert.ok(component.updateDir.calledWith(1), "updates UI direction to RTL");
 });
 
 add_task(async function testPanelStatus() {
   let deckStore = new SyncedTabsDeckStore();
   let listStore = new SyncedTabsListStore();
   let listComponent = {};
   let fxAccounts = {
     getSignedInUser() {}