Bug 726491. (Av1) Port |Bug 663630 - Remove unused places UI perf tests| to SeaMonkey. r=InvisibleSmiley.
authorSerge Gautherie <sgautherie.bz@free.fr>
Mon, 13 Feb 2012 19:06:07 +0100
changeset 9372 465ce21de933b568b949cfa3f6561d4494b08cba
parent 9371 23367078802034b888f2137483a4c356a2c7cb9e
child 9373 a489b0bb0a7f639408b7e00f76a5150acdf00c47
push id7175
push usersgautherie.bz@free.fr
push dateMon, 13 Feb 2012 18:07:16 +0000
treeherdercomm-central@465ce21de933 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersInvisibleSmiley
bugs726491, 663630
Bug 726491. (Av1) Port |Bug 663630 - Remove unused places UI perf tests| to SeaMonkey. r=InvisibleSmiley.
suite/common/places/tests/Makefile.in
suite/common/places/tests/browser/browser_ui_000_data.js
suite/common/places/tests/browser/browser_ui_history_menu.js
suite/common/places/tests/chrome/perf_large_delete.xul
--- a/suite/common/places/tests/Makefile.in
+++ b/suite/common/places/tests/Makefile.in
@@ -52,33 +52,30 @@ include $(topsrcdir)/config/rules.mk
 _CHROME_FILES = \
     test_treeview_date.xul \
     test_bug485100-change-case-loses-tag.xul \
     test_bug427633_no_newfolder_if_noip.xul \
     test_0_multiple_left_pane.xul \
     test_0_bug510634.xul \
     test_bug549192.xul \
     test_bug549491.xul \
-    perf_large_delete.xul \
     $(NULL)
 
 _BROWSER_FILES = \
     head.js \
     browser_0_library_left_pane_migration.js \
     browser_library_left_pane_fixnames.js \
     browser_425884.js \
     browser_423515.js \
     browser_457473_no_copy_guid.js \
     browser_sort_in_library.js \
     browser_library_open_leak.js \
     browser_library_left_pane_commands.js \
     browser_drag_bookmarks_on_toolbar.js \
     browser_library_views_liveupdate.js \
     browser_library_infoBox.js \
-    browser_ui_000_data.js \
-    browser_ui_history_menu.js \
     $(NULL)
 
 libs:: $(addprefix chrome/, $(_CHROME_FILES))
 	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
 
 libs:: $(addprefix browser/, $(_BROWSER_FILES))
 	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
deleted file mode 100644
--- a/suite/common/places/tests/browser/browser_ui_000_data.js
+++ /dev/null
@@ -1,163 +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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Dietrich Ayala <dietrich@mozilla.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 ***** */
-
-/*
-
-Sets up the database for subsequent performance
-tests, and test the speed of adding to history
-and bookmarks.
-
-- add XXX visits distributed over XXX days
-- add XXX bookmarks distributed over XXX days
-
-*/
-
-/*********************** begin header **********************/
-waitForExplicitFinish();
-
-const TEST_IDENTIFIER = "ui-perf-test";
-const TEST_SUITE = "places";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-
-var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
-         getService(Ci.nsIWindowMediator);
-var win = wm.getMostRecentWindow("navigator:browser");
-
-var ios = Cc["@mozilla.org/network/io-service;1"].
-          getService(Ci.nsIIOService);
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
-         getService(Ci.nsINavHistoryService);
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
-         getService(Ci.nsINavBookmarksService);
-
-function add_visit(aURI, aDate) {
-  var placeID = hs.addVisit(aURI,
-                            aDate,
-                            null, // no referrer
-                            hs.TRANSITION_TYPED, // user typed in URL bar
-                            false, // not redirect
-                            0);
-  return placeID;
-}
-
-function add_bookmark(aURI) {
-  var bId = bs.insertBookmark(bs.unfiledBookmarksFolder, aURI,
-                              bs.DEFAULT_INDEX, "bookmark/" + aURI.spec);
-  return bId;
-}
-
-function make_test_report(testName, result, units) {
-  return [TEST_IDENTIFIER, TEST_SUITE, testName, result, units||"ms"].join(":");
-}
-
-// Each test is an obj w/ a name property and run method
-var ptests = [];
-
-/*********************** end header **********************/
-
-// add visits and bookmarks
-ptests.push({
-  run: function() {
-    bs.runInBatchMode({
-      runBatched: function(aUserData) {
-        // timespan - same as default history pref for now
-        var days = 90;
-
-        // add visits, distributed across the timespan
-        var total_visits = 300;
-        var visits_per_day = total_visits/days;
-
-        var visit_date_microsec = Date.now() * 1000;
-        var day_counter = 0;
-        
-        var start = Date.now();
-        for (var i = 0; i < days; i++) {
-          visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
-          var spec = "http://example.com/" + visit_date_microsec;
-          for (var j = 0; j < visits_per_day; j++) {
-            var uri = ios.newURI(spec + j, null, null);
-            add_visit(uri, visit_date_microsec);
-          }
-        }
-        var duration = Date.now() - start;
-        var report = make_test_report("add_visits", duration);
-        ok(true, report);
-
-        // add bookmarks
-        var bookmarks_total = total_visits/10; // bookmark a tenth of the URLs in history
-        var bookmarks_per_day = bookmarks_total/days;
-
-        // reset visit date counter
-        visit_date_microsec = Date.now() * 1000;
-        var bookmark_counter = 0;
-        start = Date.now();
-        for (var i = 0; i < days; i++) {
-          visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
-          var spec = "http://example.com/" + visit_date_microsec;
-          for (var j = 0; j < visits_per_day; j++) {
-            var uri = ios.newURI(spec + j, null, null);
-            if (bookmark_counter < bookmarks_per_day) {
-              add_bookmark(uri);
-              bookmark_counter++;
-            }
-            else
-              bookmark_counter = 0;
-          }
-        }
-        duration = Date.now() - start;
-        report = make_test_report("add_bookmarks", duration);
-        ok(true, report);
-        runNextTest();
-      }
-    }, null);
-  }
-});
-
-function test() {
-  // kick off tests
-  runNextTest();
-}
-
-function runNextTest() {
-  if (ptests.length > 0)
-    ptests.shift().run();
-  else
-    finish();
-}
deleted file mode 100644
--- a/suite/common/places/tests/browser/browser_ui_history_menu.js
+++ /dev/null
@@ -1,147 +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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Dietrich Ayala <dietrich@mozilla.com>
- *   Marco Bonardo <mak77@bonardo.net>
- *
- * 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 ***** */
-
-/*
-Tests the performance of opening the history menu.
-*/
-
-/*********************** begin header **********************/
-const TEST_IDENTIFIER = "ui-perf-test";
-const TEST_SUITE = "places";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-
-var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
-         getService(Ci.nsIWindowMediator);
-var win = wm.getMostRecentWindow("navigator:browser");
-
-var ios = Cc["@mozilla.org/network/io-service;1"].
-          getService(Ci.nsIIOService);
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
-         getService(Ci.nsINavHistoryService);
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
-         getService(Ci.nsINavBookmarksService);
-
-var historyMenu = document.getElementById("history-menu");
-var historyPopup = document.getElementById("goPopup");
-
-function add_visit(aURI, aDate) {
-  var visitId = hs.addVisit(aURI,
-                            aDate,
-                            null, // no referrer
-                            hs.TRANSITION_TYPED, // user typed in URL bar
-                            false, // not redirect
-                            0);
-  return visitId;
-}
-
-function add_bookmark(aURI) {
-  var bId = bs.insertBookmark(bs.unfiledBookmarksFolder, aURI,
-                              bs.DEFAULT_INDEX, "bookmark/" + aURI.spec);
-  return bId;
-}
-
-function make_test_report(testName, result, units) {
-  return [TEST_IDENTIFIER, TEST_SUITE, testName, result, units||"ms"].join(":");
-}
-
-// Each test is an obj w/ a name property and run method
-var ptests = [];
-
-/*********************** end header **********************/
-
-const TEST_REPEAT_COUNT = 6;
-
-// test duration of history menu opening
-ptests.push({
-  name: "open_history_menu",
-  times: [],
-  run: function() {
-    var self = this;
-    var start = Date.now();
-    historyPopup.addEventListener("popupshown", function() {
-      historyPopup.removeEventListener("popupshown", arguments.callee, true);
-      executeSoon(function() {
-        var duration = Date.now() - start;
-        historyPopup.hidePopup();
-        historyMenu.open = false;
-        self.times.push(duration);
-        if (self.times.length == TEST_REPEAT_COUNT)
-          self.finish();
-        else
-          self.run();
-      });
-    }, true);
-    historyMenu.open = true;
-    historyPopup.openPopup();
-  },
-  finish: function() {
-    processTestResult(this);
-    setTimeout(runNextTest, 0);
-  }
-});
-
-function processTestResult(aTest) {
-  aTest.times.sort();  // sort the scores
-  aTest.times.pop();   // remove worst
-  aTest.times.shift(); // remove best
-  var totalDuration = aTest.times.reduce(function(time, total){ return time + total; });
-  var avgDuration = totalDuration/aTest.times.length;
-  var report = make_test_report(aTest.name, avgDuration);
-  ok(true, report);
-}
-
-function test() {
-  // Skip test on Mac due to native menus.
-  if (navigator.platform.toLowerCase().indexOf("mac") != -1)
-    return;
-
-  waitForExplicitFinish();
-
-  // kick off tests
-  setTimeout(runNextTest, 0);
-}
-
-function runNextTest() {
-  if (ptests.length > 0)
-    ptests.shift().run();
-  else
-    finish();
-}
deleted file mode 100644
--- a/suite/common/places/tests/chrome/perf_large_delete.xul
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.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 mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Shawn Wilsher <me@shawnwilsher.com> (Original Author)
- *
- * 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 ***** */
-
-/**
- * This tests that the performance of deleting a large number of bookmarks.  See
- * bug 432706 for more details.
- *
- * To run this test, run it like you would a standard chrome test, with the test
- * path being:
- * ../chrome/browser/components/places/tests/perf/perf_large_delete.xul
- */
--->
-
-<window title="Places Library Performance Test"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="test();">
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/MochiKit/packed.js"/>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-  <script type="application/javascript">
-  <![CDATA[
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-
-function test()
-{
-  let ios = Cc["@mozilla.org/network/io-service;1"].
-            getService(Ci.nsIIOService);
-
-  // First, add 250 bookmarks
-  let bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
-           getService(Ci.nsINavBookmarksService);
-  bs.runInBatchMode({
-    runBatched: function(aUserData)
-    {
-      for (let i = 0; i < 250; i++) {
-        let uri = ios.newURI("http://example.com/" + i, null, null);
-        bs.insertBookmark(bs.unfiledBookmarksFolder, uri, bs.DEFAULT_INDEX,
-                          "bookmark " + i);
-      }
-    }
-  }, null);
-
-  // Close the window if it's already open
-  let wm = Cc["@mozilla.org/appshell/window-mediator;1"].
-           getService(Ci.nsIWindowMediator);
-  let win = wm.getMostRecentWindow("Places:Organizer");
-  if (win)
-    win.close();
-
-
-  let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
-           getService(Ci.nsIWindowWatcher);
-  ww.registerNotification({
-    observe: function(aSubject, aTopic, aData)
-    {
-      if (aTopic != "domwindowopened")
-        return;
-
-      let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
-
-      // We need to run after the window is loaded, and has run its startup code
-      win.addEventListener("DOMContentLoaded", function() {
-        let tm = Cc["@mozilla.org/thread-manager;1"].
-                 getService(Ci.nsIThreadManager);
-        tm.mainThread.dispatch({
-          run: function() doTest(win.QueryInterface(Ci.nsIDOMWindow))
-        }, Ci.nsIThread.DISPATCH_NORMAL);
-      }, false);
-
-      // and now to unregister ourself as a listener
-      ww.unregisterNotification(this);
-    }
-  });
-
-  function doTest(aWin)
-  {
-    // Select all the bookmarks
-    synthesizeKey("a", {accelKey:true}, aWin);
-
-    // If we can, start shark
-    try {
-      connectShark();
-      startShark();
-    }
-    catch (e) { }
-
-    // Delete the bookmarks
-    let start = Date.now();
-    synthesizeKey("VK_BACK_SPACE", {}, aWin);
-    let end = Date.now();
-
-    // Stop shark, if we can
-    try {
-      stopShark();
-      disconnectionShark();
-    }
-    catch (e) { }
-
-    // Close the window, and write the results out
-    aWin.close();
-    document.getElementById("test-result").value =
-      "Duration was " + String(end - start) + "ms";
-
-    SimpleTest.finish();
-  }
-
-  // And open the window
-  wm.getMostRecentWindow("navigator:browser")
-    .openDialog("chrome://communicator/content/bookmarks/bookmarksManager.xul",
-                "", "chrome,toolbar=yes,dialog=no,resizable",
-                "UnfiledBookmarks");
-
-  SimpleTest.waitForExplicitFinish();
-}
-
-  ]]>
-  </script>
-
-  <body xmlns="http://www.w3.org/1999/xhtml">
-    <p id="display"></p>
-    <div id="content" style="display:none;"></div>
-    <pre id="test"></pre>
-  </body>
-  <label id="test-result"/>
-</window>