Restore browser_visibleTabs test that accidentally got removed in 87c7be4465a4.
authorEdward Lee <edilee@mozilla.com>
Tue, 10 Aug 2010 20:39:45 -0700
changeset 50314 1d767aa48e3ddfb17073e2821eb6a34b8e384e55
parent 50313 adf075d1bbd7b936eb05112de185645ac5c9129b (current diff)
parent 50312 725ea7ded18f1a934af9eb1eac53498dd47f053c (diff)
child 50315 65cc5bd8ba8a8a904daa59148009495ee355c9a4
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b4pre
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
Restore browser_visibleTabs test that accidentally got removed in 87c7be4465a4.
browser/base/content/tabview/profile.js
deleted file mode 100644
--- a/browser/base/content/tabview/profile.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is profile.js.
- *
- * The Initial Developer of the Original Code is
- * Ian Gilman <ian@iangilman.com>
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// **********
-// Title: profile.js
-
-(function() {
-// ##########
-// Class: Profile
-// A simple profiling helper.
-// TODO: remove before shipping.
-window.Profile = {
-  // Variable: silent
-  // If true, disables logging of results.
-  silent: true,
-
-  // Variable: cutoff
-  // How many ms a wrapped function needs to take before it gets logged.
-  cutoff: 4,
-
-  // Variable: _time
-  // Private. The time of the last checkpoint.
-  _time: Date.now(),
-
-  // ----------
-  // Function: wrap
-  // Wraps the given object with profiling for each method.
-  wrap: function(obj, name) {
-    let self = this;
-    [i for (i in Iterator(obj))].forEach(function([key, val]) {
-      if (typeof val != "function")
-        return;
-
-      obj[key] = function() {
-        let start = Date.now();
-        try {
-          return val.apply(obj, arguments);
-        } finally {
-          let diff = Date.now() - start;
-          if (diff >= self.cutoff && !self.silent)
-            Utils.log("profile: " + name + "." + key + " = " + diff + "ms");
-        }
-      };
-    });
-  },
-
-  // ----------
-  // Function: checkpoint
-  // Reset the clock. If label is provided, print the time in milliseconds since the last reset.
-  checkpoint: function(label) {
-    var now = Date.now();
-
-    if (label && !this.silent)
-      Utils.log("profile checkpoint: " + label + " = " + (now - this._time) + "ms");
-
-    this._time = now;
-  }
-};
-
-})();
--- a/browser/base/content/tabview/tabview.js
+++ b/browser/base/content/tabview/tabview.js
@@ -1,12 +1,8 @@
-// profile.js starts a timer to see how long this file takes to load, so it needs to be first.
-// The file should be removed before we ship.
-#include profile.js
-
 Components.utils.import("resource://gre/modules/tabview/AllTabs.jsm");
 Components.utils.import("resource://gre/modules/tabview/groups.jsm");
 Components.utils.import("resource://gre/modules/tabview/utils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gWindow", function() {
   return window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -1039,19 +1039,12 @@ var UIManager = {
     if (leftovers.length)
       putInGroupItem(leftovers, "mixed");
 
     GroupItems.arrange();
   },
 };
 
 // ----------
-Profile.checkpoint("script load");
-Profile.wrap(UIManager, "UIManager");
-Profile.wrap(Storage, "Storage");
-Profile.wrap(Items, "Items");
-Profile.wrap(TabItems, "TabItems");
-Profile.wrap(GroupItems, "GroupItems");
-
 window.UI = UIManager;
 window.UI.init();
 
 })();
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -137,16 +137,17 @@ endif
                  browser_bug555224.js \
                  browser_bug555767.js \
                  browser_bug556061.js \
                  browser_bug562649.js \
                  browser_bug563588.js \
                  browser_bug577121.js \
                  browser_bug580956.js \
                  browser_bug581242.js \
+                 browser_bookmarkAllPages.js \
                  browser_contextSearchTabPosition.js \
                  browser_ctrlTab.js \
                  browser_discovery.js \
                  browser_drag.js \
                  browser_gestureSupport.js \
                  browser_getshortcutoruri.js \
                  browser_inspector_initialization.js \
                  browser_inspector_treeSelection.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_bookmarkAllPages.js
@@ -0,0 +1,65 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is bookmark all pages test with tab view.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Raymond Lee <raymond@appcoast.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+function test() {
+  waitForExplicitFinish();
+
+  let tabOne = gBrowser.addTab("about:blank");
+  let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
+
+  gBrowser.selectedTab = tabTwo;
+
+  var browser = gBrowser.getBrowserForTab(tabTwo);
+  browser.addEventListener("load", function() {
+    gBrowser.showOnlyTheseTabs([tabTwo]);
+
+    is(gBrowser.visibleTabs.length, 1, "Only one tab is visible");
+
+    let uris = PlacesCommandHook._getUniqueTabInfo();
+    is(uris.length, 1, "Only one uri is returned");
+
+    is(uris[0].spec, tabTwo.linkedBrowser.currentURI.spec, "It's the correct URI");
+
+    gBrowser.removeTab(tabOne);
+    gBrowser.removeTab(tabTwo);
+    Array.forEach(gBrowser.tabs, function(tab) {
+      tab.hidden = false;
+    });
+
+    finish();
+  }, true);
+}
--- a/browser/base/content/test/tabview/browser_tabview_group.js
+++ b/browser/base/content/test/tabview/browser_tabview_group.js
@@ -6,17 +6,17 @@
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  * for the specific language governing rights and limitations under the
  * License.
  *
- * The Original Code is tabview drag and drop test.
+ * The Original Code is tabview group test.
  *
  * The Initial Developer of the Original Code is
  * Mozilla Foundation.
  * Portions created by the Initial Developer are Copyright (C) 2010
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  * Raymond Lee <raymond@appcoast.com>