55 const Cc = Components.classes;
56 const Ci = Components.interfaces;
57 const Cr = Components.results;
59 var
wm =
Cc[
"@mozilla.org/appshell/window-mediator;1"].
61 var
win =
wm.getMostRecentWindow(
"navigator:browser");
63 var
ios =
Cc[
"@mozilla.org/network/io-service;1"].
65 var
hs =
Cc[
"@mozilla.org/browser/nav-history-service;1"].
67 var
bs =
Cc[
"@mozilla.org/browser/nav-bookmarks-service;1"].
71 var placeID = hs.addVisit(aURI,
81 var bId = bs.insertBookmark(bs.unfiledBookmarksFolder, aURI,
82 bs.DEFAULT_INDEX,
"bookmark/" + aURI.spec);
99 runBatched:
function(aUserData) {
104 var total_visits = 300;
105 var visits_per_day = total_visits/days;
107 var visit_date_microsec = Date.now() * 1000;
110 var
start = Date.now();
111 for (var
i = 0;
i < days;
i++) {
112 visit_date_microsec -= 86400 * 1000 * 1000;
113 var spec =
"http://example.com/" + visit_date_microsec;
114 for (var j = 0; j < visits_per_day; j++) {
124 var bookmarks_total = total_visits/10;
125 var bookmarks_per_day = bookmarks_total/days;
128 visit_date_microsec = Date.now() * 1000;
129 var bookmark_counter = 0;
131 for (var
i = 0;
i < days;
i++) {
132 visit_date_microsec -= 86400 * 1000 * 1000;
133 var spec =
"http://example.com/" + visit_date_microsec;
134 for (var j = 0; j < visits_per_day; j++) {
136 if (bookmark_counter < bookmarks_per_day) {
141 bookmark_counter = 0;
144 duration = Date.now() -
start;
159 if (ptests.length > 0)
160 ptests.shift().run();
getService(Ci.sbIFaceplateManager)
function add_bookmark(aURI)
function add_visit(aURI, aDate)
function make_test_report(testName, result, units)
_getSelectedPageStyle s i