Bug 1163816: Fix Fennec bustage from bug 854982. r=jsantell, a=sylvestre
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 20 May 2015 16:33:28 -0700
changeset 274933 19e307d1bf54bba2cae00d910bdee58ab7812e1c
parent 274932 62ad4980571e585d166d419227cf498ef88645ba
child 274934 a42b2de9a9f20f9b60c9394b4c4658c235786d03
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell, sylvestre
bugs1163816, 854982
milestone40.0a2
Bug 1163816: Fix Fennec bustage from bug 854982. r=jsantell, a=sylvestre
addon-sdk/source/lib/sdk/tabs/helpers.js
addon-sdk/source/lib/sdk/tabs/tab-fennec.js
--- a/addon-sdk/source/lib/sdk/tabs/helpers.js
+++ b/addon-sdk/source/lib/sdk/tabs/helpers.js
@@ -22,11 +22,11 @@ function getTabForWindow(win) {
 
   return modelFor(tab);
 }
 exports.getTabForWindow = getTabForWindow;
 
 exports.getTabForRawTab = modelFor;
 
 function getTabForBrowser(browser) {
-  return modelFor(getRawTabForBrowser(browser));
+  return modelFor(getRawTabForBrowser(browser)) || null;
 }
 exports.getTabForBrowser = getTabForBrowser;
--- a/addon-sdk/source/lib/sdk/tabs/tab-fennec.js
+++ b/addon-sdk/source/lib/sdk/tabs/tab-fennec.js
@@ -4,24 +4,25 @@
 'use strict';
 
 const { Cc, Ci } = require('chrome');
 const { Class } = require('../core/heritage');
 const { tabNS, rawTabNS } = require('./namespace');
 const { EventTarget } = require('../event/target');
 const { activateTab, getTabTitle, setTabTitle, closeTab, getTabURL,
         getTabContentWindow, getTabForBrowser, setTabURL, getOwnerWindow,
-        getTabContentDocument, getTabContentType, getTabId } = require('./utils');
+        getTabContentDocument, getTabContentType, getTabId, isTab } = require('./utils');
 const { emit } = require('../event/core');
 const { isPrivate } = require('../private-browsing/utils');
 const { isWindowPrivate } = require('../window/utils');
 const { when: unload } = require('../system/unload');
 const { BLANK } = require('../content/thumbnail');
 const { viewFor } = require('../view/core');
 const { EVENTS } = require('./events');
+const { modelFor } = require('../model/core');
 
 const ERR_FENNEC_MSG = 'This method is not yet supported by Fennec';
 
 const Tab = Class({
   extends: EventTarget,
   initialize: function initialize(options) {
     options = options.tab ? options : { tab: options };
     let tab = options.tab;