test_bookmarksRestoreNotification.js File Reference

Go to the source code of this file.

Functions

Components utils import ("resource://gre/modules/utils.js")
 
function addBookmarks ()
 
function checkBookmarksExist ()
 
function createFile (aBasename)
 
function doNextTest ()
 
function run_test ()
 

Variables

const NSIOBSERVER_TOPIC_BEGIN = "bookmarks-restore-begin"
 
const NSIOBSERVER_TOPIC_SUCCESS = "bookmarks-restore-success"
 
const NSIOBSERVER_TOPIC_FAILED = "bookmarks-restore-failed"
 
const NSIOBSERVER_DATA_JSON = "json"
 
const NSIOBSERVER_DATA_HTML = "html"
 
const NSIOBSERVER_DATA_HTML_INIT = "html-initial"
 
var uris
 
var tests
 
var beginObserver
 
var successAndFailedObserver
 
var currTestIndex = -1
 
var bmsvc
 
var obssvc
 
var importer
 

Function Documentation

function addBookmarks ( )

Adds some bookmarks for the URIs in |uris|.

Definition at line 373 of file test_bookmarksRestoreNotification.js.

Here is the call graph for this function:

function checkBookmarksExist ( )

Checks that all of the bookmarks created for |uris| exist. It works by creating one query per URI and then ORing all the queries. The number of results returned should be uris.length.

Definition at line 386 of file test_bookmarksRestoreNotification.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function createFile (   aBasename)

Creates an nsILocalFile in the profile directory.

Parameters
aBasenamee.g., "foo.txt" in the path /some/long/path/foo.txt
Returns
The nsILocalFile

Definition at line 409 of file test_bookmarksRestoreNotification.js.

function doNextTest ( )

Runs the next test or if all tests have been run, finishes.

Definition at line 423 of file test_bookmarksRestoreNotification.js.

Here is the caller graph for this function:

Components utils import ( "resource://gre/modules/utils.js"  )
function run_test ( )

Definition at line 440 of file test_bookmarksRestoreNotification.js.

Here is the call graph for this function:

Variable Documentation

var beginObserver
Initial value:
= {
observe: function _beginObserver(aSubject, aTopic, aData) {
print(" Observed " + aTopic);
print(" Topic for current test should be what is expected");
do_check_eq(aTopic, test.currTopic);
print(" Data for current test should be what is expected");
do_check_eq(aData, test.data);
test.currTopic = test.finalTopic;
}
}
do_check_eq(typeof PlacesUtils,"object")
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe

Definition at line 304 of file test_bookmarksRestoreNotification.js.

var bmsvc
Initial value:
= Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 359 of file test_bookmarksRestoreNotification.js.

var currTestIndex = -1

Definition at line 354 of file test_bookmarksRestoreNotification.js.

var importer
Initial value:
= Cc["@mozilla.org/browser/places/import-export-service;1"].
getService(Ci.nsIPlacesImportExportService)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 365 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_DATA_HTML = "html"

Definition at line 49 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_DATA_HTML_INIT = "html-initial"

Definition at line 50 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_DATA_JSON = "json"

Definition at line 48 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_TOPIC_BEGIN = "bookmarks-restore-begin"

Tests the bookmarks-restore-* nsIObserver notifications after restoring bookmarks from JSON and HTML. See bug 470314.

Definition at line 45 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_TOPIC_FAILED = "bookmarks-restore-failed"

Definition at line 47 of file test_bookmarksRestoreNotification.js.

const NSIOBSERVER_TOPIC_SUCCESS = "bookmarks-restore-success"

Definition at line 46 of file test_bookmarksRestoreNotification.js.

var obssvc
Initial value:
= Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 362 of file test_bookmarksRestoreNotification.js.

var successAndFailedObserver
Initial value:
= {
observe: function _successAndFailedObserver(aSubject, aTopic, aData) {
print(" Observed " + aTopic);
print(" Topic for current test should be what is expected");
do_check_eq(aTopic, test.currTopic);
print(" Data for current test should be what is expected");
do_check_eq(aData, test.data);
try {
test.file.remove(false);
}
catch (exc) {}
if (aSubject) {
do_check_eq(aSubject.QueryInterface(Ci.nsISupportsPRInt64).data,
test.folderId);
}
else
do_check_eq(test.folderId, null);
}
}
do_check_eq(typeof PlacesUtils,"object")
function remove_all_bookmarks()
return null
Definition: FeedWriter.js:1143
const Ci
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe

Definition at line 322 of file test_bookmarksRestoreNotification.js.

var tests

Definition at line 73 of file test_bookmarksRestoreNotification.js.

var uris
Initial value:
= [
"http://example.com/1",
"http://example.com/2",
"http://example.com/3",
"http://example.com/4",
"http://example.com/5",
]

Definition at line 53 of file test_bookmarksRestoreNotification.js.