Open main menu

CDOT Wiki β

Changes

Contribute to Private Browsing Tests

770 bytes added, 20:41, 26 September 2008
m
History Unit Test
=== History Unit Test ===
* [[User:AaronMT|AaronMT]] 00:41, 27 September 2008 (UTC)
** Using a Mozilla function that checks to see if a URI exists in a database
{|class="collapsible" style="background: #c0c0c0" width="80%"
!test_248970_history - Function uri_in_DB(URI)
|-
| <pre>/**
* Checks to see that a URI is in the database.
*
* @param aURI
* The URI to check.
* @returns true if the URI is in the DB, false otherwise.
*/
function uri_in_db(aURI) {
var options = histsvc.getNewQueryOptions();
options.maxResults = 1;
options.resultType = options.RESULTS_AS_URI
var query = histsvc.getNewQuery();
query.uri = aURI;
var result = histsvc.executeQuery(query, options);
var root = result.root;
root.containerOpen = true;
return (root.childCount == 1);
}</pre>
 
|}
* [[User:AaronMT|AaronMT]] 23:45, 26 September 2008 (UTC)
** Wrote a new function that creates a handful of history items with various visit types.
1
edit