head_bookmarks.js File Reference

Go to the source code of this file.

Functions

 version (170)
 
function LOG (aMsg)
 
dirSvc QueryInterface (Ci.nsIDirectoryService).registerProvider(dirProvider)
 
registrar registerFactory (Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"),"XULAppInfo","@mozilla.org/xre/app-info;1", XULAppInfoFactory)
 
function uri (spec)
 
function remove_all_bookmarks ()
 
function check_no_bookmarks ()
 
function create_bookmarks_html (aFilename)
 
function remove_bookmarks_html ()
 
function check_bookmarks_html ()
 
function create_JSON_backup (aFilename)
 
function remove_all_JSON_backups ()
 
function check_JSON_backup ()
 
function dump_table (aName)
 
function flush_main_thread_events ()
 

Variables

const NS_APP_USER_PROFILE_50_DIR = "ProfD"
 
const NS_APP_PROFILE_DIR_STARTUP = "ProfDS"
 
const NS_APP_BOOKMARKS_50_FILE = "BMarks"
 
var Ci = Components.interfaces
 
var Cc = Components.classes
 
var Cr = Components.results
 
var gProfD = do_get_profile()
 
var dirSvc
 
var dirProvider
 
var XULAppInfo
 
var XULAppInfoFactory
 
var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
 
var iosvc = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
 
let gTestDir = do_get_cwd()
 
const FILENAME_BOOKMARKS_HTML = "bookmarks.html"
 
let backup_date = new Date().toLocaleFormat("%Y-%m-%d")
 
const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json"
 
const SMART_BOOKMARKS_VERSION = 2
 
const SMART_BOOKMARKS_ON_TOOLBAR = 1
 
const SMART_BOOKMARKS_ON_MENU = 3
 
const DEFAULT_BOOKMARKS_ON_TOOLBAR = 2
 
const DEFAULT_BOOKMARKS_ON_MENU = 3
 

Function Documentation

function check_bookmarks_html ( )

Check bookmarks.html file exists in the profile folder.

Returns
nsIFile object for the file.

Definition at line 209 of file head_bookmarks.js.

function check_JSON_backup ( )

Check a JSON backup file for today exists in the profile folder.

Returns
nsIFile object for the file.

Definition at line 262 of file head_bookmarks.js.

function check_no_bookmarks ( )

Definition at line 139 of file head_bookmarks.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function create_bookmarks_html (   aFilename)

Creates a bookmarks.html file in the profile folder from a given source file.

Parameters
aFilenameName of the file to copy to the profile folder. This file must exist in the directory that contains the test files.
Returns
nsIFile object for the file.

Definition at line 178 of file head_bookmarks.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function create_JSON_backup (   aFilename)

Creates a JSON backup in the profile folder folder from a given source file.

Parameters
aFilenameName of the file to copy to the profile folder. This file must exist in the directory that contains the test files.
Returns
nsIFile object for the file.

Definition at line 225 of file head_bookmarks.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function dump_table (   aName)

Dumps the rows of a table out to the console.

Parameters
aNameThe name of the table or view to output.

Definition at line 276 of file head_bookmarks.js.

Here is the call graph for this function:

flush_main_thread_events ( )

Flushes any events in the event loop of the main thread.

Definition at line 326 of file head_bookmarks.js.

function LOG (   aMsg)

Definition at line 50 of file head_bookmarks.js.

dirSvc QueryInterface ( Ci.  nsIDirectoryService)
registrar registerFactory ( Components.  ID"{fbfae60b-64a4-44ef-a911-08ceb70b9f31}",
"XULAppInfo"  ,
"@mozilla.org/xre/app-info;1"  ,
XULAppInfoFactory   
)
function remove_all_bookmarks ( )

Definition at line 125 of file head_bookmarks.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function remove_all_JSON_backups ( )

Remove bookmarksbackup dir and all backups from the profile folder.

Definition at line 248 of file head_bookmarks.js.

Here is the caller graph for this function:

function remove_bookmarks_html ( )

Remove bookmarks.html file from the profile folder.

Definition at line 195 of file head_bookmarks.js.

Here is the caller graph for this function:

function uri (   spec)

Definition at line 118 of file head_bookmarks.js.

version ( 170  )

Here is the caller graph for this function:

Variable Documentation

let backup_date = new Date().toLocaleFormat("%Y-%m-%d")

Definition at line 157 of file head_bookmarks.js.

var Cc = Components.classes

Definition at line 47 of file head_bookmarks.js.

Definition at line 46 of file head_bookmarks.js.

var Cr = Components.results

Definition at line 48 of file head_bookmarks.js.

const DEFAULT_BOOKMARKS_ON_MENU = 3

Definition at line 167 of file head_bookmarks.js.

const DEFAULT_BOOKMARKS_ON_TOOLBAR = 2

Definition at line 166 of file head_bookmarks.js.

var dirProvider
Initial value:
= {
getFile: function(prop, persistent) {
persistent.value = true;
if (prop == NS_APP_BOOKMARKS_50_FILE) {
var bmarks = gProfD.clone();
bmarks.append("bookmarks.html");
return bmarks;
}
return null;
},
QueryInterface: function(iid) {
if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
iid.equals(Ci.nsISupports)) {
return this;
}
throw Cr.NS_ERROR_NO_INTERFACE;
}
}
const NS_APP_BOOKMARKS_50_FILE
var Ci
function getFile(fileName)
var Cr
dirSvc QueryInterface(Ci.nsIDirectoryService).registerProvider(dirProvider)
return null
Definition: FeedWriter.js:1143
var gProfD

Definition at line 61 of file head_bookmarks.js.

var dirSvc
Initial value:
= Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties)
var Ci
getService(Ci.sbIFaceplateManager)
var Cc

Definition at line 58 of file head_bookmarks.js.

const FILENAME_BOOKMARKS_HTML = "bookmarks.html"

Definition at line 156 of file head_bookmarks.js.

const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json"

Definition at line 158 of file head_bookmarks.js.

var gProfD = do_get_profile()

Definition at line 57 of file head_bookmarks.js.

let gTestDir = do_get_cwd()

Definition at line 155 of file head_bookmarks.js.

var iosvc = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)

Definition at line 116 of file head_bookmarks.js.

const NS_APP_BOOKMARKS_50_FILE = "BMarks"

Definition at line 44 of file head_bookmarks.js.

const NS_APP_PROFILE_DIR_STARTUP = "ProfDS"

Definition at line 43 of file head_bookmarks.js.

const NS_APP_USER_PROFILE_50_DIR = "ProfD"

Definition at line 42 of file head_bookmarks.js.

var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar)

Definition at line 111 of file head_bookmarks.js.

const SMART_BOOKMARKS_ON_MENU = 3

Definition at line 163 of file head_bookmarks.js.

const SMART_BOOKMARKS_ON_TOOLBAR = 1

Definition at line 162 of file head_bookmarks.js.

const SMART_BOOKMARKS_VERSION = 2

Definition at line 161 of file head_bookmarks.js.

var XULAppInfo
Initial value:
= {
vendor: "Mozilla",
name: "PlacesTest",
ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
version: "1",
appBuildID: "2007010101",
platformVersion: "",
platformBuildID: "2007010101",
inSafeMode: false,
logConsoleErrors: true,
OS: "XPCShell",
XPCOMABI: "noarch-spidermonkey",
QueryInterface: function QueryInterface(iid) {
if (iid.equals(Ci.nsIXULAppInfo) ||
iid.equals(Ci.nsIXULRuntime) ||
iid.equals(Ci.nsISupports))
return this;
throw Cr.NS_ERROR_NO_INTERFACE;
}
}
version(170)
var Ci
var Cr
dirSvc QueryInterface(Ci.nsIDirectoryService).registerProvider(dirProvider)

Definition at line 81 of file head_bookmarks.js.

var XULAppInfoFactory
Initial value:
= {
createInstance: function (outer, iid) {
if (outer != null)
throw Cr.NS_ERROR_NO_AGGREGATION;
return XULAppInfo.QueryInterface(iid);
}
}
var XULAppInfo
sidebarFactory createInstance
Definition: nsSidebar.js:351
var Cr
return null
Definition: FeedWriter.js:1143

Definition at line 103 of file head_bookmarks.js.