Bug 1229831 - tab group migration code loses group titles, r=felipe
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 02 Dec 2015 17:31:22 +0000
changeset 309351 33a59952118a0cf7387190dc92abd255cf530c62
parent 309350 4f704aecb2496b6aa9082ad1f61d9dcbddb5d638
child 309352 ed6fd38d7eb2782a3d6562f22786d66f8c7db9aa
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1229831
milestone45.0a1
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
Bug 1229831 - tab group migration code loses group titles, r=felipe
browser/modules/TabGroupsMigrator.jsm
browser/modules/test/xpcshell/test_TabGroupsMigrator.js
--- a/browser/modules/TabGroupsMigrator.jsm
+++ b/browser/modules/TabGroupsMigrator.jsm
@@ -157,17 +157,17 @@ this.TabGroupsMigrator = {
           return 1;
         }
         return a.anonGroupID - b.anonGroupID;
       });
       for (let group of windowGroups) {
         let groupFolder = yield PlacesUtils.bookmarks.insert({
           parentGuid: tabgroupsFolder.guid,
           type: PlacesUtils.bookmarks.TYPE_FOLDER,
-          title: group.title ||
+          title: group.tabGroupsMigrationTitle ||
             gBrowserBundle.formatStringFromName("tabgroups.migration.anonGroup", [group.anonGroupID], 1),
         }).catch(Cu.reportError);
 
         for (let tab of group.tabs) {
           let entry = tab.entries[tab.index - 1];
           yield PlacesUtils.bookmarks.insert({
             parentGuid: groupFolder.guid,
             title: tab.title || entry.title,
--- a/browser/modules/test/xpcshell/test_TabGroupsMigrator.js
+++ b/browser/modules/test/xpcshell/test_TabGroupsMigrator.js
@@ -73,17 +73,19 @@ add_task(function* gatherGroupDataTest()
   if (group13) {
     Assert.equal(group13.tabs.length, 1, "1 tabs in group 13");
     Assert.equal(group13.title, "Foopy", "Group with title has correct title");
     Assert.ok(!("anonGroupID" in group13), "We don't mark a titled group with an anonymous id");
   }
 });
 
 add_task(function* bookmarkingTest() {
-  let groupInfo = TabGroupsMigrator._gatherGroupData(TEST_STATES.TWO_GROUPS);
+  let stateClone = JSON.parse(JSON.stringify(TEST_STATES.TWO_GROUPS));
+  let groupInfo = TabGroupsMigrator._gatherGroupData(stateClone);
+  let removedGroups = TabGroupsMigrator._removeHiddenTabGroupsFromState(stateClone, groupInfo);
   yield TabGroupsMigrator._bookmarkAllGroupsFromState(groupInfo);
   let bmCounter = 0;
   let bmParents = {};
   let bookmarks = [];
   let onResult = bm => {
     bmCounter++;
     bmParents[bm.parentGuid] = (bmParents[bm.parentGuid] || 0) + 1;
     Assert.ok(bm.title.startsWith("Robots "), "Bookmark title(" + bm.title + ")  should start with 'Robots '");