browser_library_search.js File Reference

Go to the source code of this file.

Functions

function getDefaultScope (aFolderId)
 
function getSelectedScopeButtonId ()
 
function queryStringToQuery (aPlaceURI)
 
function resetSearch (aExpectedScopeButtonId)
 
function search (aFolderId, aSearchStr, aExpectedScopeButtonId)
 
function selectScope (aScopeButtonId)
 
function testHelper (aLibraryWin)
 
function test ()
 

Variables

const TEST_URL = "http://dummy.mozilla.org/"
 
var testCases
 
const bmsvc
 
const histsvc
 
var libraryWin
 

Function Documentation

function getDefaultScope (   aFolderId)

Returns the default search scope for a given folder.

Parameters
aFolderIdthe item ID of a node in the left pane's tree
Returns
the default scope when the folder is newly selected

Definition at line 132 of file browser_library_search.js.

function getSelectedScopeButtonId ( )

Returns the ID of the search scope button that is currently checked.

Returns
the ID of the selected scope folder button

Definition at line 143 of file browser_library_search.js.

Here is the call graph for this function:

function queryStringToQuery (   aPlaceURI)

Returns the single nsINavHistoryQuery represented by a given place URI.

Parameters
aPlaceURIa URI that represents a single query
Returns
an nsINavHistoryQuery object

Definition at line 160 of file browser_library_search.js.

Here is the caller graph for this function:

function resetSearch (   aExpectedScopeButtonId)

Resets the search by clearing the search box's text and ensures that the search scope remains as expected.

Parameters
aExpectedScopeButtonIdthis button should be selected after the reset

Definition at line 173 of file browser_library_search.js.

Here is the call graph for this function:

function search (   aFolderId,
  aSearchStr,
  aExpectedScopeButtonId 
)

Performs a search for a given folder and search string and ensures that the URI of the right pane's content tree is as expected for the folder and search string. Also ensures that the search scope button is as expected after the search.

Parameters
aFolderIdthe item ID of a node in the left pane's tree
aSearchStrthe search text; may be empty to reset the search
aExpectedScopeButtonIdafter searching the selected scope button should be this

Definition at line 190 of file browser_library_search.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function selectScope (   aScopeButtonId)

Clicks the given search scope button if it is enabled.

Parameters
aScopeButtonIdthe button with this ID will be clicked
Returns
true if the button is enabled, false otherwise

Definition at line 251 of file browser_library_search.js.

Here is the call graph for this function:

function test ( )

Definition at line 285 of file browser_library_search.js.

Here is the call graph for this function:

function testHelper (   aLibraryWin)

test() contains window-launching boilerplate that calls this to really kick things off. Add functions to the testCases array, and this will call them.

Parameters
aLibraryWinthe Places Library window

Definition at line 270 of file browser_library_search.js.

Here is the caller graph for this function:

Variable Documentation

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

Definition at line 117 of file browser_library_search.js.

const histsvc
Initial value:
= Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 119 of file browser_library_search.js.

var libraryWin

Definition at line 121 of file browser_library_search.js.

const TEST_URL = "http://dummy.mozilla.org/"

Bug 451151 https://bugzilla.mozilla.org/show_bug.cgi?id=451151

Summary: Tests frontend Places Library searching – search, search reset, search scope consistency.

Details: Each test below

  1. selects a folder in the left pane and ensures that the content tree is appropriately updated,
  2. performs a search and ensures that the content tree is correct for the folder and search and that the search UI is visible and appropriate to folder,
  3. ensures that the folder scope button is disabled appropriate to the folder,
  4. if the folder scope button is enabled clicks it,
  5. resets the search and ensures that the content tree is correct and that the search UI is hidden, and
  6. if folder scope was clicked, searches again and ensures folder scope remains selected.

Definition at line 63 of file browser_library_search.js.

var testCases

Definition at line 66 of file browser_library_search.js.