code: function tabView_waitForOpened() {
      // Add event listener to wait until the tabview has been opened
      var self = { opened: false };
      function checkOpened() { self.opened = true; }
      this._controller.window.addEventListener("tabviewshown", checkOpened, false);
  
      try {
        mozmill.utils.waitFor(function() {
          return self.opened == true;
        }, TIMEOUT, 100, "TabView is not open.");
  
        this._tabViewObject = this._controller.window.TabView;
        this._groupItemsObject = this._tabViewObject._window.GroupItems;
        this._tabItemsObject = this._tabViewObject._window.TabItems;
      } finally {
        this._controller.window.removeEventListener("tabviewshown", checkOpened, false);
      }
    }
docs: Wait until the Tab View has been opened