Bug 892073 - Remove unused Panel UI
authorRodrigo Silveira <rsilveira@mozilla.com>
Tue, 23 Jul 2013 14:22:31 -0700
changeset 152009 87976cbb35d78375c100775ef71f26dee7c3614d
parent 152008 2571b6bbc93ae0b5226430c4e66a6caefd41c3f7
child 152010 a9714e5897799814cf4c134cc710bbb797e44992
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs892073
milestone25.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 892073 - Remove unused Panel UI
browser/metro/base/content/RemoteTabs.js
browser/metro/base/content/bookmarks.js
browser/metro/base/content/browser-scripts.js
browser/metro/base/content/browser-ui.js
browser/metro/base/content/history.js
browser/metro/base/tests/mochitest/browser_bookmarks.js
browser/metro/base/tests/mochitest/browser_history.js
--- a/browser/metro/base/content/RemoteTabs.js
+++ b/browser/metro/base/content/RemoteTabs.js
@@ -117,30 +117,8 @@ let RemoteTabsStartView = {
   uninit: function uninit() {
     this._view.destruct();
   },
 
   show: function show() {
     this._grid.arrangeItems();
   }
 };
-
-let RemoteTabsPanelView = {
-  _view: null,
-
-  get _grid() { return document.getElementById("remotetabs-list"); },
-  get visible() { return PanelUI.isPaneVisible("remotetabs-container"); },
-
-  init: function init() {
-    //decks are fragile, don't hide the tab panel(bad things happen), hide link in menu.
-    let snappedEntry = document.getElementById("snappedRemoteTabsLabel");
-    let uiList = [snappedEntry];
-    this._view = new RemoteTabsView(this._grid, uiList);
-  },
-
-  show: function show() {
-    this._grid.arrangeItems();
-  },
-
-  uninit: function uninit() {
-    this._view.destruct();
-  }
-};
--- a/browser/metro/base/content/bookmarks.js
+++ b/browser/metro/base/content/bookmarks.js
@@ -365,36 +365,16 @@ var BookmarksStartView = {
     this._view.destruct();
   },
 
   show: function show() {
     this._grid.arrangeItems();
   }
 };
 
-var BookmarksPanelView = {
-  _view: null,
-
-  get _grid() { return document.getElementById("bookmarks-list"); },
-  get visible() { return PanelUI.isPaneVisible("bookmarks-container"); },
-
-  init: function init() {
-    this._view = new BookmarksView(this._grid, null, Bookmarks.metroRoot);
-  },
-
-  show: function show() {
-    this._view.getBookmarks(true);
-    this._grid.arrangeItems();
-  },
-
-  uninit: function uninit() {
-    this._view.destruct();
-  }
-};
-
 /**
  * Observes bookmark changes and keeps a linked BookmarksView updated.
  *
  * @param aView An instance of BookmarksView.
  */
 function BookmarkChangeListener(aView) {
   this._view = aView;
 }
--- a/browser/metro/base/content/browser-scripts.js
+++ b/browser/metro/base/content/browser-scripts.js
@@ -118,36 +118,33 @@ let ScriptContexts = {};
   ["SelectionHelperUI", "chrome://browser/content/helperui/SelectionHelperUI.js"],
   ["SelectionPrototype", "chrome://browser/content/library/SelectionPrototype.js"],
   ["ChromeSelectionHandler", "chrome://browser/content/helperui/ChromeSelectionHandler.js"],
   ["AnimatedZoom", "chrome://browser/content/AnimatedZoom.js"],
   ["CommandUpdater", "chrome://browser/content/commandUtil.js"],
   ["ContextCommands", "chrome://browser/content/ContextCommands.js"],
   ["Bookmarks", "chrome://browser/content/bookmarks.js"],
   ["Downloads", "chrome://browser/content/downloads.js"],
-  ["BookmarksPanelView", "chrome://browser/content/bookmarks.js"],
   ["ConsolePanelView", "chrome://browser/content/console.js"],
   ["BookmarksStartView", "chrome://browser/content/bookmarks.js"],
   ["HistoryView", "chrome://browser/content/history.js"],
   ["HistoryStartView", "chrome://browser/content/history.js"],
-  ["HistoryPanelView", "chrome://browser/content/history.js"],
   ["Site", "chrome://browser/content/Site.js"],
   ["TopSites", "chrome://browser/content/TopSites.js"],
   ["TopSitesView", "chrome://browser/content/TopSites.js"],
   ["TopSitesStartView", "chrome://browser/content/TopSites.js"],
   ["Sanitizer", "chrome://browser/content/sanitize.js"],
   ["SanitizeUI", "chrome://browser/content/sanitizeUI.js"],
   ["SSLExceptions", "chrome://browser/content/exceptions.js"],
   ["ItemPinHelper", "chrome://browser/content/helperui/ItemPinHelper.js"],
   ["NavButtonSlider", "chrome://browser/content/NavButtonSlider.js"],
   ["ContextUI", "chrome://browser/content/ContextUI.js"],
   ["FlyoutPanelsUI", "chrome://browser/content/flyouts/flyoutUI.js"],
 #ifdef MOZ_SERVICES_SYNC
   ["RemoteTabsView", "chrome://browser/content/RemoteTabs.js"],
-  ["RemoteTabsPanelView", "chrome://browser/content/RemoteTabs.js"],
   ["RemoteTabsStartView", "chrome://browser/content/RemoteTabs.js"],
 #endif
 ].forEach(function (aScript) {
   let [name, script] = aScript;
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox;
     if (script in ScriptContexts) {
       sandbox = ScriptContexts[script];
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -1225,20 +1225,17 @@ var StartUI = {
 var PanelUI = {
   get _panels() { return document.getElementById("panel-items"); },
 
   get isVisible() {
     return !Elements.panelUI.hidden;
   },
 
   views: {
-    "bookmarks-container": "BookmarksPanelView",
     "console-container": "ConsolePanelView",
-    "remotetabs-container": "RemoteTabsPanelView",
-    "history-container" : "HistoryPanelView"
   },
 
   init: function() {
     // Perform core init soon
     setTimeout(function () {
       for each (let viewName in this.views) {
         let view = window[viewName];
         if (view.init)
--- a/browser/metro/base/content/history.js
+++ b/browser/metro/base/content/history.js
@@ -287,27 +287,8 @@ let HistoryStartView = {
     this._view = new HistoryView(this._grid, StartUI.maxResultsPerSection, true);
     this._view.populateGrid();
   },
 
   uninit: function uninit() {
     this._view.destruct();
   }
 };
-
-let HistoryPanelView = {
-  _view: null,
-  get _grid() { return document.getElementById("history-list"); },
-  get visible() { return PanelUI.isPaneVisible("history-container"); },
-
-  show: function show() {
-    this._view.populateGrid(true);
-    this._grid.arrangeItems();
-  },
-
-  init: function init() {
-    this._view = new HistoryView(this._grid, StartUI.maxResultsPerSection, false);
-  },
-
-  uninit: function uninit() {
-    this._view.destruct();
-  }
-};
--- a/browser/metro/base/tests/mochitest/browser_bookmarks.js
+++ b/browser/metro/base/tests/mochitest/browser_bookmarks.js
@@ -1,17 +1,16 @@
 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 let gStartView = BookmarksStartView._view;
-let gPanelView = BookmarksPanelView._view;
 
 function test() {
   runTests();
 }
 
 function setup() {
   PanelUI.hide();
   BookmarksTestHelper.setup();
@@ -60,17 +59,16 @@ var BookmarksTestHelper = {
     getItemIndex: function (aIndex) aIndex,
     getBookmarkURI: function (aId) BookmarksTestHelper._nodes[aId].uri,
     getItemTitle: function (aId) BookmarksTestHelper._nodes[aId].title,
     removeItem: function (aId) {
       delete BookmarksTestHelper._nodes[aId];
 
       // Simulate observer notification
       gStartView._changes.onItemRemoved(aId, gStartView._root);
-      gPanelView._changes.onItemRemoved(aId, gPanelView._root);
     },
   },
 
   Node: function (aTitle, aId) {
     this.type = this.RESULT_TYPE_URI = 0;
     this.title = aTitle;
     this.itemId = aId;
     this.uri = "http://" + aTitle + ".com.br";
@@ -95,51 +93,38 @@ var BookmarksTestHelper = {
   _originalUpdateFavicon: null,
   setup: function setup() {
     // Just enough items so that there will be one less then the limit
     // after removing 4 items.
     this.createNodes(gStartView._limit + 3);
 
     this._originalNavHistoryService = gStartView._navHistoryService;
     gStartView._navHistoryService = this.MockNavHistoryService;
-    gPanelView._navHistoryService = this.MockNavHistoryService;
 
     this._originalBookmarkService = gStartView._bookmarkService;
     gStartView._bookmarkService= this.MockBookmarkService;
-    gPanelView._bookmarkService= this.MockBookmarkService;
 
     this._originalPinHelper = gStartView._pinHelper;
     gStartView._pinHelper = this.MockPinHelper;
-    gPanelView._pinHelper = this.MockPinHelper;
 
     this._originalUpdateFavicon = gStartView._updateFavicon;
     gStartView._updateFavicon = function () {};
-    gPanelView._updateFavicon = function () {};
 
     gStartView.clearBookmarks();
     gStartView.getBookmarks();
-    gPanelView.clearBookmarks();
-    gPanelView.getBookmarks();
   },
 
   restore: function () {
     gStartView._navHistoryService = this._originalNavHistoryService;
     gStartView._bookmarkService= this._originalBookmarkService;
     gStartView._pinHelper = this._originalPinHelper;
     gStartView._updateFavicon = this._originalUpdateFavicon;
 
-    gPanelView._navHistoryService = this._originalNavHistoryService;
-    gPanelView._bookmarkService= this._originalBookmarkService;
-    gPanelView._pinHelper = this._originalPinHelper;
-    gPanelView._updateFavicon = this._originalUpdateFavicon;
-
     gStartView.clearBookmarks();
     gStartView.getBookmarks();
-    gPanelView.clearBookmarks();
-    gPanelView.getBookmarks();
   }
 };
 
 gTests.push({
   desc: "Test bookmarks StartUI unpin",
   setUp: setup,
   tearDown: tearDown,
   run: function testBookmarksStartUnpin() {
@@ -345,220 +330,8 @@ gTests.push({
     item3 = gStartView._getItemForBookmarkId(12);
 
     ok(!item1 && !item2 && !item3, "Items are not in grid");
     ok(!BookmarksTestHelper._nodes[0] && !BookmarksTestHelper._nodes[5] && !BookmarksTestHelper._nodes[12],
       "Items are gone");
     ok(gStartView._set.itemCount === gStartView._limit - 1, "Grid repopulated");
   }
 });
-
-gTests.push({
-  desc: "Test bookmarks PanelUI unpin",
-  setUp: setup,
-  tearDown: tearDown,
-  run: function testBookmarksPanelUnpin() {
-    PanelUI.show('bookmarks-container');
-
-    let pinButton = document.getElementById("pin-selected-button");
-    let unpinButton = document.getElementById("unpin-selected-button");
-
-    // --------- unpin item 2
-
-    let item = gPanelView._getItemForBookmarkId(2);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    yield waitForCondition(() => !unpinButton.hidden);
-
-    ok(!unpinButton.hidden, "Unpin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(unpinButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._getItemForBookmarkId(2);
-    let startItem = gStartView._getItemForBookmarkId(2);
-
-    ok(item, "Item is in grid");
-    ok(!startItem, "Item not in start grid");
-    ok(!gPanelView._pinHelper.isPinned(2), "Item unpinned");
-
-    // --------- unpin multiple items
-
-    let item1 = gPanelView._getItemForBookmarkId(0);
-    let item2 = gPanelView._getItemForBookmarkId(5);
-    let item3 = gPanelView._getItemForBookmarkId(12);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    ok(!unpinButton.hidden, "Unpin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(unpinButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._getItemForBookmarkId(0);
-    item2 = gPanelView._getItemForBookmarkId(5);
-    item3 = gPanelView._getItemForBookmarkId(12);
-    let startItem1 = gStartView._getItemForBookmarkId(0);
-    let startItem2 = gStartView._getItemForBookmarkId(5);
-    let startItem3 = gStartView._getItemForBookmarkId(12);
-
-    ok(item1 && item2 && item3, "Items are in grid");
-    ok(!startItem1 && !startItem2 && !startItem3, "Items are not in start grid");
-    ok(!gPanelView._pinHelper.isPinned(0) && !gPanelView._pinHelper.isPinned(5) && !gPanelView._pinHelper.isPinned(12) , "Items unpinned");
-
-    // --------- pin item 2
-
-    let item = gPanelView._getItemForBookmarkId(2);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    // Make sure app bar is updated
-    yield waitForCondition(() => !pinButton.hidden);
-
-    ok(!pinButton.hidden, "Pin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(pinButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._getItemForBookmarkId(2);
-    let startItem = gStartView._getItemForBookmarkId(2);
-
-    ok(item, "Item is in grid");
-    ok(startItem, "Item is back in start grid");
-    ok(gPanelView._pinHelper.isPinned(2), "Item pinned");
-
-    // --------- pin multiple items
-
-    let item1 = gPanelView._getItemForBookmarkId(0);
-    let item2 = gPanelView._getItemForBookmarkId(5);
-    let item3 = gPanelView._getItemForBookmarkId(12);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    // Make sure app bar is updated
-    yield waitForCondition(() => !pinButton.hidden);
-
-    ok(!pinButton.hidden, "pin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(pinButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._getItemForBookmarkId(0);
-    item2 = gPanelView._getItemForBookmarkId(5);
-    item3 = gPanelView._getItemForBookmarkId(12);
-    let startItem1 = gStartView._getItemForBookmarkId(0);
-    let startItem2 = gStartView._getItemForBookmarkId(5);
-    let startItem3 = gStartView._getItemForBookmarkId(12);
-
-    ok(item1 && item2 && item3, "Items are in grid");
-    ok(startItem1 && startItem2 && startItem3, "Items are back in start grid");
-    ok(gPanelView._pinHelper.isPinned(0) && gPanelView._pinHelper.isPinned(5) && gPanelView._pinHelper.isPinned(12) , "Items pinned");
-  }
-});
-
-gTests.push({
-  desc: "Test bookmarks PanelUI delete",
-  setUp: setup,
-  tearDown: tearDown,
-  run: function testBookmarksPanelDelete() {
-    PanelUI.show('bookmarks-container');
-
-    let restoreButton = document.getElementById("restore-selected-button");
-    let deleteButton = document.getElementById("delete-selected-button");
-
-    // --------- delete item 2
-
-    let item = gPanelView._getItemForBookmarkId(2);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    ok(!deleteButton.hidden, "Delete button is visible.");
-
-    let promise = waitForCondition(() => !restoreButton.hidden);
-    EventUtils.synthesizeMouse(deleteButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._getItemForBookmarkId(2);
-    let startItem = gStartView._getItemForBookmarkId(2);
-
-    ok(!item, "Item is not in grid");
-    ok(startItem, "Item is not deleted from start grid yet");
-    ok(BookmarksTestHelper._nodes[2], "Item exists");
-    ok(!restoreButton.hidden, "Restore button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    Elements.contextappbar.dismiss();
-    yield promise;
-
-    item = gPanelView._getItemForBookmarkId(2);
-    startItem = gStartView._getItemForBookmarkId(2);
-
-    ok(!item, "Item gone from grid");
-    ok(!startItem, "Item gone from start grid");
-    ok(!BookmarksTestHelper._nodes[2], "Item RIP");
-
-    // --------- delete multiple items
-
-    let item1 = gPanelView._getItemForBookmarkId(0);
-    let item2 = gPanelView._getItemForBookmarkId(5);
-    let item3 = gPanelView._getItemForBookmarkId(12);
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    ok(!deleteButton.hidden, "Delete button is visible.");
-
-    let promise = waitForCondition(() => !restoreButton.hidden);
-    EventUtils.synthesizeMouse(deleteButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._getItemForBookmarkId(0);
-    item2 = gPanelView._getItemForBookmarkId(5);
-    item3 = gPanelView._getItemForBookmarkId(12);
-    let startItem1 = gStartView._getItemForBookmarkId(0);
-    let startItem2 = gStartView._getItemForBookmarkId(5);
-    let startItem3 = gStartView._getItemForBookmarkId(12);
-
-    ok(!restoreButton.hidden, "Restore button is visible.");
-    ok(!item1 && !item2 && !item3, "Items are not in grid");
-    ok(startItem1 && startItem2 && startItem3, "Items are still in start grid");
-    ok(BookmarksTestHelper._nodes[0] && BookmarksTestHelper._nodes[5] && BookmarksTestHelper._nodes[12],
-      "Items not deleted yet");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    Elements.contextappbar.dismiss();
-    yield promise;
-
-    item1 = gPanelView._getItemForBookmarkId(0);
-    item2 = gPanelView._getItemForBookmarkId(5);
-    item3 = gPanelView._getItemForBookmarkId(12);
-    let startItem1 = gStartView._getItemForBookmarkId(0);
-    let startItem2 = gStartView._getItemForBookmarkId(5);
-    let startItem3 = gStartView._getItemForBookmarkId(12);
-
-    ok(!item1 && !item2 && !item3, "Items are gone from grid");
-    ok(!startItem1 && !startItem2 && !startItem3, "Items are gone from start grid");
-    ok(!BookmarksTestHelper._nodes[0] && !BookmarksTestHelper._nodes[5] && !BookmarksTestHelper._nodes[12],
-      "Items are gone for good");
-  }
-});
--- a/browser/metro/base/tests/mochitest/browser_history.js
+++ b/browser/metro/base/tests/mochitest/browser_history.js
@@ -1,17 +1,16 @@
 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 let gStartView = HistoryStartView._view;
-let gPanelView = HistoryPanelView._view;
 
 function test() {
   runTests();
 }
 
 function scrollToEnd() {
   let startBox = document.getElementById("start-scrollbox");
   let [, scrollInterface] = ScrollUtils.getScrollboxFromElement(startBox);
@@ -66,17 +65,16 @@ var HistoryTestHelper = {
 
   _originalHistoryService: null,
   MockHistoryService: {
     removePage: function (aURI) {
       delete HistoryTestHelper._nodes[aURI.spec];
 
       // Simulate observer notification
       gStartView.onDeleteURI(aURI);
-      gPanelView.onDeleteURI(aURI);
     },
   },
 
   Node: function (aTitle, aURISpec) {
     this.title = aTitle;
     this.uri = aURISpec;
     this.pinned = true
   },
@@ -101,45 +99,34 @@ var HistoryTestHelper = {
 
   setup: function setup() {
     // Just enough items so that there will be one less then the limit
     // after removing 4 items.
     this.createNodes(gStartView._limit + 3);
 
     this._originalNavHistoryService = gStartView._navHistoryService;
     gStartView._navHistoryService = this.MockNavHistoryService;
-    gPanelView._navHistoryService = this.MockNavHistoryService;
 
     this._originalHistoryService = gStartView._historyService;
     gStartView._historyService= this.MockHistoryService;
-    gPanelView._historyService= this.MockHistoryService;
 
     this._originalPinHelper = gStartView._pinHelper;
     gStartView._pinHelper = this.MockPinHelper;
-    gPanelView._pinHelper = this.MockPinHelper;
 
     gStartView._set.clearAll();
     gStartView.populateGrid();
-    gPanelView._set.clearAll();
-    gPanelView.populateGrid();
   },
 
   restore: function () {
     gStartView._navHistoryService = this._originalNavHistoryService;
     gStartView._historyService= this._originalHistoryService;
     gStartView._pinHelper = this._originalPinHelper;
 
-    gPanelView._navHistoryService = this._originalNavHistoryService;
-    gPanelView._historyService= this._originalHistoryService;
-    gPanelView._pinHelper = this._originalPinHelper;
-
     gStartView._set.clearAll();
     gStartView.populateGrid();
-    gPanelView._set.clearAll();
-    gPanelView.populateGrid();
   }
 };
 
 function uriFromIndex(aIndex) {
   return "http://mock-history-" + aIndex + ".com.br/"
 }
 
 gTests.push({
@@ -358,223 +345,8 @@ gTests.push({
     item3 = gStartView._set.getItemsByUrl(uriFromIndex(12))[0];
 
     ok(!item1 && !item2 && !item3, "Items are not in grid");
     ok(!HistoryTestHelper._nodes[uriFromIndex(0)] && !HistoryTestHelper._nodes[uriFromIndex(5)] && !HistoryTestHelper._nodes[uriFromIndex(12)],
       "Items are gone");
     ok(gStartView._set.itemCount === gStartView._limit - 1, "Grid repopulated");
   }
 });
-
-gTests.push({
-  desc: "Test history PanelUI unpin",
-  setUp: setup,
-  tearDown: tearDown,
-  run: function testHistoryPanelUnpin() {
-    PanelUI.show('history-container');
-
-    let pinButton = document.getElementById("pin-selected-button");
-    let unpinButton = document.getElementById("unpin-selected-button");
-
-    // --------- unpin item 2
-
-    let item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    yield waitForCondition(() => !unpinButton.hidden);
-
-    ok(!unpinButton.hidden, "Unpin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(unpinButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-    let startItem = gStartView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    ok(item, "Item is in grid");
-    ok(!startItem, "Item not in start grid");
-    ok(!gPanelView._pinHelper.isPinned(uriFromIndex(2)), "Item unpinned");
-
-    // --------- unpin multiple items
-
-    let item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    scrollToEnd();
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    ok(!unpinButton.hidden, "Unpin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(unpinButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-    let startItem1 = gStartView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let startItem2 = gStartView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let startItem3 = gStartView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    ok(item1 && item2 && item3, "Items are in grid");
-    ok(!startItem1 && !startItem2 && !startItem3, "Items are not in start grid");
-    ok(!gPanelView._pinHelper.isPinned(uriFromIndex(0)) && !gPanelView._pinHelper.isPinned(uriFromIndex(5)) && !gPanelView._pinHelper.isPinned(uriFromIndex(12)) , "Items unpinned");
-
-    // --------- pin item 2
-
-    let item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    // Make sure app bar is updated
-    yield waitForCondition(() => !pinButton.hidden);
-
-    ok(!pinButton.hidden, "Pin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(pinButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-    let startItem = gStartView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    ok(item, "Item is in grid");
-    ok(startItem, "Item is back in start grid");
-    ok(gPanelView._pinHelper.isPinned(uriFromIndex(2)), "Item pinned");
-
-    // --------- pin multiple items
-
-    let item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    scrollToEnd();
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    // Make sure app bar is updated
-    yield waitForCondition(() => !pinButton.hidden);
-
-    ok(!pinButton.hidden, "pin button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    EventUtils.synthesizeMouse(pinButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-    let startItem1 = gStartView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let startItem2 = gStartView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let startItem3 = gStartView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    ok(item1 && item2 && item3, "Items are in grid");
-    ok(startItem1 && startItem2 && startItem3, "Items are back in start grid");
-    ok(gPanelView._pinHelper.isPinned(uriFromIndex(0)) && gPanelView._pinHelper.isPinned(uriFromIndex(5)) && gPanelView._pinHelper.isPinned(uriFromIndex(12)) , "Items pinned");
-  }
-});
-
-gTests.push({
-  desc: "Test history PanelUI delete",
-  setUp: setup,
-  tearDown: tearDown,
-  run: function testHistoryPanelDelete() {
-    PanelUI.show('history-container');
-
-    let restoreButton = document.getElementById("restore-selected-button");
-    let deleteButton = document.getElementById("delete-selected-button");
-
-    // --------- delete item 2
-
-    let item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item, 10, 10);
-    yield promise;
-
-    ok(!deleteButton.hidden, "Delete button is visible.");
-
-    let promise = waitForCondition(() => !restoreButton.hidden);
-    EventUtils.synthesizeMouse(deleteButton, 10, 10, {}, window);
-    yield promise;
-
-    item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-    let startItem = gStartView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    ok(!item, "Item is not in grid");
-    ok(startItem, "Item is not deleted from start grid yet");
-    ok(HistoryTestHelper._nodes[uriFromIndex(2)], "Item exists");
-    ok(!restoreButton.hidden, "Restore button is visible.");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    Elements.contextappbar.dismiss();
-    yield promise;
-
-    item = gPanelView._set.getItemsByUrl(uriFromIndex(2))[0];
-    startItem = gStartView._set.getItemsByUrl(uriFromIndex(2))[0];
-
-    ok(!item, "Item gone from grid");
-    ok(!startItem, "Item gone from start grid");
-    ok(!HistoryTestHelper._nodes[uriFromIndex(2)], "Item RIP");
-
-    // --------- delete multiple items
-
-    let item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    scrollToEnd();
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    sendContextMenuClickToElement(window, item1, 10, 10);
-    sendContextMenuClickToElement(window, item2, 10, 10);
-    sendContextMenuClickToElement(window, item3, 10, 10);
-    yield promise;
-
-    ok(!deleteButton.hidden, "Delete button is visible.");
-
-    let promise = waitForCondition(() => !restoreButton.hidden);
-    EventUtils.synthesizeMouse(deleteButton, 10, 10, {}, window);
-    yield promise;
-
-    item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-    let startItem1 = gStartView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let startItem2 = gStartView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let startItem3 = gStartView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    ok(!restoreButton.hidden, "Restore button is visible.");
-    ok(!item1 && !item2 && !item3, "Items are not in grid");
-    ok(startItem1 && startItem2 && startItem3, "Items are still in start grid");
-    ok(HistoryTestHelper._nodes[uriFromIndex(0)] && HistoryTestHelper._nodes[uriFromIndex(5)] && HistoryTestHelper._nodes[uriFromIndex(12)],
-      "Items not deleted yet");
-
-    let promise = waitForEvent(Elements.contextappbar, "transitionend", null, Elements.contextappbar);
-    Elements.contextappbar.dismiss();
-    yield promise;
-
-    item1 = gPanelView._set.getItemsByUrl(uriFromIndex(0))[0];
-    item2 = gPanelView._set.getItemsByUrl(uriFromIndex(5))[0];
-    item3 = gPanelView._set.getItemsByUrl(uriFromIndex(12))[0];
-    let startItem1 = gStartView._set.getItemsByUrl(uriFromIndex(0))[0];
-    let startItem2 = gStartView._set.getItemsByUrl(uriFromIndex(5))[0];
-    let startItem3 = gStartView._set.getItemsByUrl(uriFromIndex(12))[0];
-
-    ok(!item1 && !item2 && !item3, "Items are gone from grid");
-    ok(!startItem1 && !startItem2 && !startItem3, "Items are gone from start grid");
-    ok(!HistoryTestHelper._nodes[uriFromIndex(0)] && !HistoryTestHelper._nodes[uriFromIndex(5)] && !HistoryTestHelper._nodes[uriFromIndex(12)],
-      "Items are gone for good");
-  }
-});