Bug 1337509 - Do not create tab objects with an unsupported 'selected' property. r?bsilverberg draft
authorTushar Saini (:shatur) <tushar.saini1285@gmail.com>
Tue, 11 Apr 2017 00:34:35 +0530
changeset 559887 d45b316c01c15fbee3a053770639c6344a4a4816
parent 559326 c6dd79ff61be3c1f1e6a8e4811ed5fc1e884feba
child 623547 a95710cdcbadefe21c429982c1ddf2ed37c12b9b
push id53256
push userbmo:tushar.saini1285@gmail.com
push dateMon, 10 Apr 2017 19:05:46 +0000
reviewersbsilverberg
bugs1337509
milestone55.0a1
Bug 1337509 - Do not create tab objects with an unsupported 'selected' property. r?bsilverberg MozReview-Commit-ID: As6hJJKHOqp
browser/components/extensions/ext-utils.js
browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_tabs.js
browser/components/extensions/test/browser/browser_ext_tabs_create.js
toolkit/components/extensions/ExtensionTabs.jsm
--- a/browser/components/extensions/ext-utils.js
+++ b/browser/components/extensions/ext-utils.js
@@ -528,17 +528,16 @@ class Tab extends TabBase {
    * @returns {Object}
    * @static
    */
   static convertFromSessionStoreClosedData(extension, tabData, window = null) {
     let result = {
       sessionId: String(tabData.closedId),
       index: tabData.pos ? tabData.pos : 0,
       windowId: window && windowTracker.getId(window),
-      selected: false,
       highlighted: false,
       active: false,
       pinned: false,
       incognito: Boolean(tabData.state && tabData.state.isPrivate),
     };
 
     if (extension.tabManager.hasTabPermission(tabData)) {
       let entries = tabData.state ? tabData.state.entries : tabData.entries;
--- a/browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_tabs.js
+++ b/browser/components/extensions/test/browser/browser_ext_sessions_getRecentlyClosed_tabs.js
@@ -3,16 +3,17 @@
 "use strict";
 
 function expectedTabInfo(tab, window) {
   let browser = tab.linkedBrowser;
   return {
     url: browser.currentURI.spec,
     title: browser.contentTitle,
     favIconUrl: window.gBrowser.getIcon(tab),
+    selected: undefined,
   };
 }
 
 function checkTabInfo(expected, actual) {
   for (let prop in expected) {
     is(actual[prop], expected[prop], `Expected value found for ${prop} of tab object.`);
   }
 }
--- a/browser/components/extensions/test/browser/browser_ext_tabs_create.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_create.js
@@ -36,16 +36,17 @@ add_task(function* test_create_options()
 
         function runTests() {
           const DEFAULTS = {
             index: 2,
             windowId: activeWindow,
             active: true,
             pinned: false,
             url: "about:newtab",
+            selected: undefined,
           };
 
           let tests = [
             {
               create: {url: "http://example.com/"},
               result: {url: "http://example.com/"},
             },
             {
--- a/toolkit/components/extensions/ExtensionTabs.jsm
+++ b/toolkit/components/extensions/ExtensionTabs.jsm
@@ -456,17 +456,16 @@ class TabBase {
    *
    * @returns {object}
    */
   convert() {
     let result = {
       id: this.id,
       index: this.index,
       windowId: this.windowId,
-      selected: this.selected,
       highlighted: this.selected,
       active: this.selected,
       pinned: this.pinned,
       status: this.status,
       incognito: this.incognito,
       width: this.width,
       height: this.height,
       audible: this.audible,