Bug 1085428 - Replaced do_log_info with do_print. r=mak

This commit is contained in:
Swapnil R Patil 2015-01-30 22:36:34 +01:00
Родитель 047b066e28
Коммит d674965080
58 изменённых файлов: 505 добавлений и 516 удалений

Просмотреть файл

@ -24,7 +24,7 @@ add_task(function smart_bookmarks_disabled() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_eq(smartBookmarkItemIds.length, 0);
do_log_info("check that pref has not been bumped up");
do_print("check that pref has not been bumped up");
do_check_eq(Services.prefs.getIntPref("browser.places.smartBookmarksVersion"), -1);
});
@ -34,7 +34,7 @@ add_task(function create_smart_bookmarks() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_neq(smartBookmarkItemIds.length, 0);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});
@ -42,14 +42,14 @@ add_task(function remove_smart_bookmark_and_restore() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
let smartBookmarksCount = smartBookmarkItemIds.length;
do_log_info("remove one smart bookmark and restore");
do_print("remove one smart bookmark and restore");
PlacesUtils.bookmarks.removeItem(smartBookmarkItemIds[0]);
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
gluesvc.ensurePlacesDefaultQueriesInitialized();
smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});
@ -57,7 +57,7 @@ add_task(function move_smart_bookmark_rename_and_restore() {
let smartBookmarkItemIds =
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO);
let smartBookmarksCount = smartBookmarkItemIds.length;
do_log_info("smart bookmark should be restored in place");
do_print("smart bookmark should be restored in place");
let parent = PlacesUtils.bookmarks.getFolderIdForItem(smartBookmarkItemIds[0]);
let oldTitle = PlacesUtils.bookmarks.getItemTitle(smartBookmarkItemIds[0]);
// create a subfolder and move inside it
@ -76,6 +76,6 @@ add_task(function move_smart_bookmark_rename_and_restore() {
do_check_eq(smartBookmarkItemIds.length, smartBookmarksCount);
do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(smartBookmarkItemIds[0]), newParent);
do_check_eq(PlacesUtils.bookmarks.getItemTitle(smartBookmarkItemIds[0]), oldTitle);
do_log_info("check that pref has been bumped up");
do_print("check that pref has been bumped up");
do_check_true(Services.prefs.getIntPref("browser.places.smartBookmarksVersion") > 0);
});

Просмотреть файл

@ -63,7 +63,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import()
{
do_log_info("Import from bookmarks.html if importBookmarksHTML is true.");
do_print("Import from bookmarks.html if importBookmarksHTML is true.");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -86,7 +86,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces().
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -94,8 +94,8 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_noSmartBookmarks()
{
do_log_info("import from bookmarks.html, but don't create smart bookmarks \
if they are disabled");
do_print("import from bookmarks.html, but don't create smart bookmarks \
if they are disabled");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -119,7 +119,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces().
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -127,8 +127,8 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_autoExport_updatedSmartBookmarks()
{
do_log_info("Import from bookmarks.html, but don't create smart bookmarks \
if autoExportHTML is true and they are at latest version");
do_print("Import from bookmarks.html, but don't create smart bookmarks \
if autoExportHTML is true and they are at latest version");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -154,7 +154,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -162,8 +162,8 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_import_autoExport_oldSmartBookmarks()
{
do_log_info("Import from bookmarks.html, and create smart bookmarks if \
autoExportHTML is true and they are not at latest version.");
do_print("Import from bookmarks.html, and create smart bookmarks if \
autoExportHTML is true and they are not at latest version.");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -190,7 +190,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -198,8 +198,8 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_restore()
{
do_log_info("restore from default bookmarks.html if \
restore_default_bookmarks is true.");
do_print("restore from default bookmarks.html if \
restore_default_bookmarks is true.");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -222,7 +222,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);
@ -231,8 +231,8 @@ function waitForImportAndSmartBookmarks(aCallback) {
function test_restore_import()
{
do_log_info("setting both importBookmarksHTML and \
restore_default_bookmarks should restore defaults.");
do_print("setting both importBookmarksHTML and \
restore_default_bookmarks should restore defaults.");
remove_all_bookmarks();
// Sanity check: we should not have any bookmark on the toolbar.
@ -257,7 +257,7 @@ function waitForImportAndSmartBookmarks(aCallback) {
run_next_test();
});
// Force nsBrowserGlue::_initPlaces()
do_log_info("Simulate Places init");
do_print("Simulate Places init");
bg.QueryInterface(Ci.nsIObserver).observe(null,
TOPIC_BROWSERGLUE_TEST,
TOPICDATA_FORCE_PLACES_INIT);

Просмотреть файл

@ -38,7 +38,7 @@ function setupBehaviorAndMigrate(aDefaultBehavior, aAutocompleteEnabled = true)
};
add_task(function*() {
do_log_info("Migrate default.behavior = 0");
do_print("Migrate default.behavior = 0");
setupBehaviorAndMigrate(0);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -52,7 +52,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 1");
do_print("Migrate default.behavior = 1");
setupBehaviorAndMigrate(1);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -66,7 +66,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 2");
do_print("Migrate default.behavior = 2");
setupBehaviorAndMigrate(2);
Assert.equal(gGetBoolPref("browser.urlbar.suggest.history"), false,
@ -80,7 +80,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 3");
do_print("Migrate default.behavior = 3");
setupBehaviorAndMigrate(3);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -94,7 +94,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 19");
do_print("Migrate default.behavior = 19");
setupBehaviorAndMigrate(19);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -108,7 +108,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 33");
do_print("Migrate default.behavior = 33");
setupBehaviorAndMigrate(33);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -122,7 +122,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 129");
do_print("Migrate default.behavior = 129");
setupBehaviorAndMigrate(129);
Assert.ok(gGetBoolPref("browser.urlbar.suggest.history"),
@ -136,7 +136,7 @@ add_task(function*() {
});
add_task(function*() {
do_log_info("Migrate default.behavior = 0, autocomplete.enabled = false");
do_print("Migrate default.behavior = 0, autocomplete.enabled = false");
setupBehaviorAndMigrate(0, false);
Assert.equal(gGetBoolPref("browser.urlbar.suggest.history"), false,

Просмотреть файл

@ -36,7 +36,7 @@ add_task(function* test_same_date_same_hash() {
converter.charset = "UTF-8";
let result = yield OS.File.read(mostRecentBackupFile);
let jsonString = converter.convertFromByteArray(result, result.length);
do_log_info("Check is valid JSON");
do_print("Check is valid JSON");
JSON.parse(jsonString);
// Cleanup
@ -66,7 +66,7 @@ add_task(function* test_same_date_diff_hash() {
converter.charset = "UTF-8";
let result = yield OS.File.read(mostRecentBackupFile, { compression: "lz4" });
let jsonString = converter.convertFromByteArray(result, result.length);
do_log_info("Check is valid JSON");
do_print("Check is valid JSON");
JSON.parse(jsonString);
// Cleanup

Просмотреть файл

@ -30,15 +30,15 @@ add_task(function() {
PlacesUtils.bookmarks.removeItem(f1);
yield BookmarkJSONUtils.importFromFile((yield PlacesBackups.getMostRecentBackup()), true);
do_log_info("Checking first level");
do_print("Checking first level");
let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
let level1 = root.getChild(0);
do_check_eq(level1.title, "f1");
do_log_info("Checking second level");
do_print("Checking second level");
PlacesUtils.asContainer(level1).containerOpen = true
let level2 = level1.getChild(0);
do_check_eq(level2.title, "f2");
do_log_info("Checking bookmark");
do_print("Checking bookmark");
PlacesUtils.asContainer(level2).containerOpen = true
let bookmark = level2.getChild(0);
do_check_eq(bookmark.title, "bookmark");

Просмотреть файл

@ -27,7 +27,7 @@ add_task(function() {
PlacesUtils.bookmarks.removeItem(bm);
yield BookmarkHTMLUtils.importFromFile(file, true);
do_log_info("Checking first level");
do_print("Checking first level");
let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
let node = root.getChild(0);
do_check_eq(node.uri, uri.spec);

Просмотреть файл

@ -33,7 +33,7 @@ let observer = {
onItemChanged: function(aItemId, aProperty, aIsAnnotation, aNewValue,
aLastModified, aItemType)
{
do_log_info("Check that we got the correct change information.");
do_print("Check that we got the correct change information.");
do_check_neq(this.bookmarks.indexOf(aItemId), -1);
if (aProperty == "favicon") {
do_check_false(aIsAnnotation);
@ -57,7 +57,7 @@ let observer = {
},
onItemVisited: function(aItemId, aVisitId, aTime)
{
do_log_info("Check that we got the correct visit information.");
do_print("Check that we got the correct visit information.");
do_check_neq(this.bookmarks.indexOf(aItemId), -1);
this.observedVisitId = aVisitId;
do_check_eq(aTime, NOW);

Просмотреть файл

@ -11,7 +11,7 @@ let gBookmarksObserver = {
let args = this.expected.shift().args;
do_check_eq(aArguments.length, args.length);
for (let i = 0; i < aArguments.length; i++) {
do_log_info(aMethodName + "(args[" + i + "]: " + args[i].name + ")");
do_print(aMethodName + "(args[" + i + "]: " + args[i].name + ")");
do_check_true(args[i].check(aArguments[i]));
}

Просмотреть файл

@ -59,7 +59,7 @@ function run_test() {
};
add_task(function test_replaceFaviconData_validHistoryURI() {
do_log_info("test replaceFaviconData for valid history uri");
do_print("test replaceFaviconData for valid history uri");
let pageURI = uri("http://test1.bar/");
yield promiseAddVisits(pageURI);
@ -87,7 +87,7 @@ add_task(function test_replaceFaviconData_validHistoryURI() {
});
add_task(function test_replaceFaviconData_overrideDefaultFavicon() {
do_log_info("test replaceFaviconData to override a later setAndFetchFaviconForPage");
do_print("test replaceFaviconData to override a later setAndFetchFaviconForPage");
let pageURI = uri("http://test2.bar/");
yield promiseAddVisits(pageURI);
@ -119,7 +119,7 @@ add_task(function test_replaceFaviconData_overrideDefaultFavicon() {
});
add_task(function test_replaceFaviconData_replaceExisting() {
do_log_info("test replaceFaviconData to override a previous setAndFetchFaviconForPage");
do_print("test replaceFaviconData to override a previous setAndFetchFaviconForPage");
let pageURI = uri("http://test3.bar");
yield promiseAddVisits(pageURI);
@ -156,7 +156,7 @@ add_task(function test_replaceFaviconData_replaceExisting() {
});
add_task(function test_replaceFaviconData_unrelatedReplace() {
do_log_info("test replaceFaviconData to not make unrelated changes");
do_print("test replaceFaviconData to not make unrelated changes");
let pageURI = uri("http://test4.bar/");
yield promiseAddVisits(pageURI);
@ -188,7 +188,7 @@ add_task(function test_replaceFaviconData_unrelatedReplace() {
});
add_task(function test_replaceFaviconData_badInputs() {
do_log_info("test replaceFaviconData to throw on bad inputs");
do_print("test replaceFaviconData to throw on bad inputs");
let favicon = createFavicon("favicon8.png");
@ -228,7 +228,7 @@ add_task(function test_replaceFaviconData_badInputs() {
});
add_task(function test_replaceFaviconData_twiceReplace() {
do_log_info("test replaceFaviconData on multiple replacements");
do_print("test replaceFaviconData on multiple replacements");
let pageURI = uri("http://test5.bar/");
yield promiseAddVisits(pageURI);

Просмотреть файл

@ -63,7 +63,7 @@ function run_test() {
};
add_task(function test_replaceFaviconDataFromDataURL_validHistoryURI() {
do_log_info("test replaceFaviconDataFromDataURL for valid history uri");
do_print("test replaceFaviconDataFromDataURL for valid history uri");
let pageURI = uri("http://test1.bar/");
yield promiseAddVisits(pageURI);
@ -89,7 +89,7 @@ add_task(function test_replaceFaviconDataFromDataURL_validHistoryURI() {
});
add_task(function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() {
do_log_info("test replaceFaviconDataFromDataURL to override a later setAndFetchFaviconForPage");
do_print("test replaceFaviconDataFromDataURL to override a later setAndFetchFaviconForPage");
let pageURI = uri("http://test2.bar/");
yield promiseAddVisits(pageURI);
@ -119,7 +119,7 @@ add_task(function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() {
});
add_task(function test_replaceFaviconDataFromDataURL_replaceExisting() {
do_log_info("test replaceFaviconDataFromDataURL to override a previous setAndFetchFaviconForPage");
do_print("test replaceFaviconDataFromDataURL to override a previous setAndFetchFaviconForPage");
let pageURI = uri("http://test3.bar");
yield promiseAddVisits(pageURI);
@ -152,7 +152,7 @@ add_task(function test_replaceFaviconDataFromDataURL_replaceExisting() {
});
add_task(function test_replaceFaviconDataFromDataURL_unrelatedReplace() {
do_log_info("test replaceFaviconDataFromDataURL to not make unrelated changes");
do_print("test replaceFaviconDataFromDataURL to not make unrelated changes");
let pageURI = uri("http://test4.bar/");
yield promiseAddVisits(pageURI);
@ -182,7 +182,7 @@ add_task(function test_replaceFaviconDataFromDataURL_unrelatedReplace() {
});
add_task(function test_replaceFaviconDataFromDataURL_badInputs() {
do_log_info("test replaceFaviconDataFromDataURL to throw on bad inputs");
do_print("test replaceFaviconDataFromDataURL to throw on bad inputs");
let favicon = createFavicon("favicon8.png");
@ -210,7 +210,7 @@ add_task(function test_replaceFaviconDataFromDataURL_badInputs() {
});
add_task(function test_replaceFaviconDataFromDataURL_twiceReplace() {
do_log_info("test replaceFaviconDataFromDataURL on multiple replacements");
do_print("test replaceFaviconDataFromDataURL on multiple replacements");
let pageURI = uri("http://test5.bar/");
yield promiseAddVisits(pageURI);
@ -241,7 +241,7 @@ add_task(function test_replaceFaviconDataFromDataURL_twiceReplace() {
});
add_task(function test_replaceFaviconDataFromDataURL_afterRegularAssign() {
do_log_info("test replaceFaviconDataFromDataURL after replaceFaviconData");
do_print("test replaceFaviconDataFromDataURL after replaceFaviconData");
let pageURI = uri("http://test6.bar/");
yield promiseAddVisits(pageURI);
@ -274,7 +274,7 @@ add_task(function test_replaceFaviconDataFromDataURL_afterRegularAssign() {
});
add_task(function test_replaceFaviconDataFromDataURL_beforeRegularAssign() {
do_log_info("test replaceFaviconDataFromDataURL before replaceFaviconData");
do_print("test replaceFaviconDataFromDataURL before replaceFaviconData");
let pageURI = uri("http://test7.bar/");
yield promiseAddVisits(pageURI);

Просмотреть файл

@ -760,17 +760,6 @@ function do_check_guid_for_bookmark(aId,
}
}
/**
* Logs info to the console in the standard way (includes the filename).
*
* @param aMessage
* The message to log to the console.
*/
function do_log_info(aMessage)
{
print("TEST-INFO | " + _TEST_FILE + " | " + aMessage);
}
/**
* Compares 2 arrays returning whether they contains the same elements.
*

Просмотреть файл

@ -139,7 +139,7 @@ function ensure_results(aSearchString, aExpectedValue) {
waitForCleanup(run_next_test);
};
do_log_info("Searching for: '" + aSearchString + "'");
do_print("Searching for: '" + aSearchString + "'");
controller.startSearch(aSearchString);
}
@ -153,7 +153,7 @@ function run_test() {
gAutoCompleteTests.forEach(function (testData) {
let [description, searchString, expectedValue, setupFunc] = testData;
add_test(function () {
do_log_info(description);
do_print(description);
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);

Просмотреть файл

@ -92,8 +92,8 @@ function continue_test() {
try {
while(stmt.executeStep()) {
let comparator = EXPECTED.shift();
do_log_info("Checking that '" + comparator.url +
"' was entered into the DB correctly");
do_print("Checking that '" + comparator.url +
"' was entered into the DB correctly");
do_check_eq(stmt.row.id, comparator.id);
do_check_eq(stmt.row.url, comparator.url);
do_check_eq(stmt.row.from_visit, comparator.from_visit);
@ -155,7 +155,7 @@ ChannelListener.prototype = {
},
onStartRequest: function(request, context) {
do_log_info("onStartRequest");
do_print("onStartRequest");
this._got_onstartrequest = true;
},
@ -164,7 +164,7 @@ ChannelListener.prototype = {
},
onStopRequest: function(request, context, status) {
do_log_info("onStopRequest");
do_print("onStopRequest");
this._got_onstoprequest++;
let success = Components.isSuccessCode(status);
do_check_true(success);
@ -177,7 +177,7 @@ ChannelListener.prototype = {
// nsIChannelEventSink
asyncOnChannelRedirect: function (aOldChannel, aNewChannel, aFlags, callback) {
do_log_info("onChannelRedirect");
do_print("onChannelRedirect");
this._got_onchannelredirect = true;
callback.onRedirectVerifyCallback(Components.results.NS_OK);
},

Просмотреть файл

@ -13,29 +13,29 @@
function tags_getter_setter()
{
do_log_info("Tags getter/setter should work correctly");
do_log_info("Without setting tags, tags getter should return empty array");
do_print("Tags getter/setter should work correctly");
do_print("Without setting tags, tags getter should return empty array");
var [query, dummy] = makeQuery();
do_check_eq(query.tags.length, 0);
do_log_info("Setting tags to an empty array, tags getter should return "+
"empty array");
do_print("Setting tags to an empty array, tags getter should return "+
"empty array");
[query, dummy] = makeQuery([]);
do_check_eq(query.tags.length, 0);
do_log_info("Setting a few tags, tags getter should return correct array");
do_print("Setting a few tags, tags getter should return correct array");
var tags = ["bar", "baz", "foo"];
[query, dummy] = makeQuery(tags);
setsAreEqual(query.tags, tags, true);
do_log_info("Setting some dupe tags, tags getter return unique tags");
do_print("Setting some dupe tags, tags getter return unique tags");
[query, dummy] = makeQuery(["foo", "foo", "bar", "foo", "baz", "bar"]);
setsAreEqual(query.tags, ["bar", "baz", "foo"], true);
},
function invalid_setter_calls()
{
do_log_info("Invalid calls to tags setter should fail");
do_print("Invalid calls to tags setter should fail");
try {
var query = PlacesUtils.history.getNewQuery();
query.tags = null;
@ -105,19 +105,19 @@
function not_setting_tags()
{
do_log_info("Not setting tags at all should not affect query URI");
do_print("Not setting tags at all should not affect query URI");
checkQueryURI();
},
function empty_array_tags()
{
do_log_info("Setting tags with an empty array should not affect query URI");
do_print("Setting tags with an empty array should not affect query URI");
checkQueryURI([]);
},
function set_tags()
{
do_log_info("Setting some tags should result in correct query URI");
do_print("Setting some tags should result in correct query URI");
checkQueryURI([
"foo",
"七難",
@ -133,22 +133,22 @@
function no_tags_tagsAreNot()
{
do_log_info("Not setting tags at all but setting tagsAreNot should " +
"affect query URI");
do_print("Not setting tags at all but setting tagsAreNot should " +
"affect query URI");
checkQueryURI(null, true);
},
function empty_array_tags_tagsAreNot()
{
do_log_info("Setting tags with an empty array and setting tagsAreNot " +
"should affect query URI");
do_print("Setting tags with an empty array and setting tagsAreNot " +
"should affect query URI");
checkQueryURI([], true);
},
function ()
{
do_log_info("Setting some tags and setting tagsAreNot should result in " +
"correct query URI");
do_print("Setting some tags and setting tagsAreNot should result in " +
"correct query URI");
checkQueryURI([
"foo",
"七難",
@ -164,8 +164,8 @@
function tag_to_uri()
{
do_log_info("Querying history on tag associated with a URI should return " +
"that URI");
do_print("Querying history on tag associated with a URI should return " +
"that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo"]);
executeAndCheckQueryResults(query, opts, [aURI.spec]);
@ -178,8 +178,8 @@
function tags_to_uri()
{
do_log_info("Querying history on many tags associated with a URI should " +
"return that URI");
do_print("Querying history on many tags associated with a URI should " +
"return that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bar"]);
executeAndCheckQueryResults(query, opts, [aURI.spec]);
@ -194,8 +194,8 @@
function repeated_tag()
{
do_log_info("Specifying the same tag multiple times in a history query " +
"should not matter");
do_print("Specifying the same tag multiple times in a history query " +
"should not matter");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "foo"]);
executeAndCheckQueryResults(query, opts, [aURI.spec]);
@ -206,8 +206,8 @@
function many_tags_no_uri()
{
do_log_info("Querying history on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
do_print("Querying history on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bogus"]);
executeAndCheckQueryResults(query, opts, []);
@ -220,7 +220,7 @@
function nonexistent_tags()
{
do_log_info("Querying history on nonexistent tags should return no results");
do_print("Querying history on nonexistent tags should return no results");
yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["bogus"]);
executeAndCheckQueryResults(query, opts, []);
@ -231,8 +231,8 @@
function tag_to_bookmark()
{
do_log_info("Querying bookmarks on tag associated with a URI should " +
"return that URI");
do_print("Querying bookmarks on tag associated with a URI should " +
"return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -248,8 +248,8 @@
function many_tags_to_bookmark()
{
do_log_info("Querying bookmarks on many tags associated with a URI " +
"should return that URI");
do_print("Querying bookmarks on many tags associated with a URI " +
"should return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bar"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -268,8 +268,8 @@
function repeated_tag_to_bookmarks()
{
do_log_info("Specifying the same tag multiple times in a bookmark query " +
"should not matter");
do_print("Specifying the same tag multiple times in a bookmark query " +
"should not matter");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "foo"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -282,8 +282,8 @@
function many_tags_no_bookmark()
{
do_log_info("Querying bookmarks on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
do_print("Querying bookmarks on many tags associated with a URI and " +
"tags not associated with that URI should not return that URI");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["foo", "bogus"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -299,7 +299,7 @@
function nonexistent_tags_bookmark()
{
do_log_info("Querying bookmarks on nonexistent tag should return no results");
do_print("Querying bookmarks on nonexistent tag should return no results");
yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
var [query, opts] = makeQuery(["bogus"]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
@ -312,14 +312,14 @@
function tagsAreNot_history()
{
do_log_info("Querying history using tagsAreNot should work correctly");
do_print("Querying history using tagsAreNot should work correctly");
var urisAndTags = {
"http://example.com/1": ["foo", "bar"],
"http://example.com/2": ["baz", "qux"],
"http://example.com/3": null
};
do_log_info("Add visits and tag the URIs");
do_print("Add visits and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
yield promiseAddVisits(nsiuri);
@ -327,27 +327,27 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info(' Querying for "foo" should match only /2 and /3');
do_print(' Querying for "foo" should match only /2 and /3');
var [query, opts] = makeQuery(["foo"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bar" should match only /2 and /3');
do_print(' Querying for "foo" and "bar" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bar"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bogus" should match only /2 and /3');
do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bogus"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "baz" should match only /3');
do_print(' Querying for "foo" and "baz" should match only /3');
[query, opts] = makeQuery(["foo", "baz"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/3"]);
do_log_info(' Querying for "bogus" should match all');
do_print(' Querying for "bogus" should match all');
[query, opts] = makeQuery(["bogus"], true);
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/1",
@ -365,14 +365,14 @@
function tagsAreNot_bookmarks()
{
do_log_info("Querying bookmarks using tagsAreNot should work correctly");
do_print("Querying bookmarks using tagsAreNot should work correctly");
var urisAndTags = {
"http://example.com/1": ["foo", "bar"],
"http://example.com/2": ["baz", "qux"],
"http://example.com/3": null
};
do_log_info("Add bookmarks and tag the URIs");
do_print("Add bookmarks and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
addBookmark(nsiuri);
@ -380,31 +380,31 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info(' Querying for "foo" should match only /2 and /3');
do_print(' Querying for "foo" should match only /2 and /3');
var [query, opts] = makeQuery(["foo"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bar" should match only /2 and /3');
do_print(' Querying for "foo" and "bar" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bar"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "bogus" should match only /2 and /3');
do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
[query, opts] = makeQuery(["foo", "bogus"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/2", "http://example.com/3"]);
do_log_info(' Querying for "foo" and "baz" should match only /3');
do_print(' Querying for "foo" and "baz" should match only /3');
[query, opts] = makeQuery(["foo", "baz"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
["http://example.com/3"]);
do_log_info(' Querying for "bogus" should match all');
do_print(' Querying for "bogus" should match all');
[query, opts] = makeQuery(["bogus"], true);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
@ -422,16 +422,16 @@
},
function duplicate_tags() {
do_log_info("Duplicate existing tags (i.e., multiple tag folders with " +
"same name) should not throw off query results");
do_print("Duplicate existing tags (i.e., multiple tag folders with " +
"same name) should not throw off query results");
var tagName = "foo";
do_log_info("Add bookmark and tag it normally");
do_print("Add bookmark and tag it normally");
addBookmark(TEST_URI);
PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
do_log_info("Manually create tag folder with same name as tag and insert " +
"bookmark");
do_print("Manually create tag folder with same name as tag and insert " +
"bookmark");
var dupTagId = PlacesUtils.bookmarks.createFolder(PlacesUtils.tagsFolderId,
tagName,
Ci.nsINavBookmarksService.DEFAULT_INDEX);
@ -442,7 +442,7 @@
"title");
do_check_true(bmId > 0);
do_log_info("Querying for tag should match URI");
do_print("Querying for tag should match URI");
var [query, opts] = makeQuery([tagName]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
@ -453,21 +453,21 @@
function folder_named_as_tag()
{
do_log_info("Regular folders with the same name as tag should not throw " +
"off query results");
do_print("Regular folders with the same name as tag should not throw " +
"off query results");
var tagName = "foo";
do_log_info("Add bookmark and tag it");
do_print("Add bookmark and tag it");
addBookmark(TEST_URI);
PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
do_log_info("Create folder with same name as tag");
do_print("Create folder with same name as tag");
var folderId = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
tagName,
Ci.nsINavBookmarksService.DEFAULT_INDEX);
do_check_true(folderId > 0);
do_log_info("Querying for tag should match URI");
do_print("Querying for tag should match URI");
var [query, opts] = makeQuery([tagName]);
opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
@ -477,7 +477,7 @@
},
function ORed_queries() {
do_log_info("Multiple queries ORed together should work");
do_print("Multiple queries ORed together should work");
var urisAndTags = {
"http://example.com/1": [],
"http://example.com/2": []
@ -490,7 +490,7 @@
urisAndTags["http://example.com/2"].push("/2 tag " + i);
}
do_log_info("Add visits and tag the URIs");
do_print("Add visits and tag the URIs");
for (let [pURI, tags] in Iterator(urisAndTags)) {
let nsiuri = uri(pURI);
yield promiseAddVisits(nsiuri);
@ -498,40 +498,40 @@
PlacesUtils.tagging.tagURI(nsiuri, tags);
}
do_log_info("Query for /1 OR query for /2 should match both /1 and /2");
do_print("Query for /1 OR query for /2 should match both /1 and /2");
var [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
var [query2, dummy] = makeQuery(urisAndTags["http://example.com/2"]);
var root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
do_log_info("Query for /1 OR query on bogus tag should match only /1");
do_print("Query for /1 OR query on bogus tag should match only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(["bogus"]);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 OR query for /1 should match only /1");
do_print("Query for /1 OR query for /1 should match only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/1"]);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 with tagsAreNot OR query for /2 with tagsAreNot " +
"should match both /1 and /2");
do_print("Query for /1 with tagsAreNot OR query for /2 with tagsAreNot " +
"should match both /1 and /2");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"], true);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/2"], true);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
do_log_info("Query for /1 OR query for /2 with tagsAreNot should match " +
"only /1");
do_print("Query for /1 OR query for /2 with tagsAreNot should match " +
"only /1");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/2"], true);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
queryResultsAre(root, ["http://example.com/1"]);
do_log_info("Query for /1 OR query for /1 with tagsAreNot should match " +
"both URIs");
do_print("Query for /1 OR query for /1 with tagsAreNot should match " +
"both URIs");
[query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
[query2, dummy] = makeQuery(urisAndTags["http://example.com/1"], true);
root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
@ -568,7 +568,7 @@ function addBookmark(aURI) {
aURI,
Ci.nsINavBookmarksService.DEFAULT_INDEX,
aURI.spec);
do_log_info("Sanity check: insertBookmark should not fail");
do_print("Sanity check: insertBookmark should not fail");
do_check_true(bmId > 0);
}
@ -596,7 +596,7 @@ function checkQueryURI(aTags, aTagsAreNot) {
var expURI = "place:" + pairs.join("&");
var [query, opts] = makeQuery(aTags, aTagsAreNot);
var actualURI = queryURI(query, opts);
do_log_info("Query URI should be what we expect for the given tags");
do_print("Query URI should be what we expect for the given tags");
do_check_eq(actualURI, expURI);
}
@ -683,7 +683,7 @@ function executeAndCheckQueryResults(aQuery, aQueryOpts, aExpectedURIs) {
*/
function makeQuery(aTags, aTagsAreNot) {
aTagsAreNot = !!aTagsAreNot;
do_log_info("Making a query " +
do_print("Making a query " +
(aTags ?
"with tags " + aTags.toSource() :
"without calling setTags() at all") +
@ -701,7 +701,7 @@ function makeQuery(aTags, aTagsAreNot) {
uniqueTags.sort();
}
do_log_info("Made query should be correct for tags and tagsAreNot");
do_print("Made query should be correct for tags and tagsAreNot");
if (uniqueTags)
setsAreEqual(query.tags, uniqueTags, true);
var expCount = uniqueTags ? uniqueTags.length : 0;

Просмотреть файл

@ -122,12 +122,12 @@ function* check_autocomplete(test) {
let numSearchesStarted = 0;
input.onSearchBegin = () => {
do_log_info("onSearchBegin received");
do_print("onSearchBegin received");
numSearchesStarted++;
};
let deferred = Promise.defer();
input.onSearchComplete = () => {
do_log_info("onSearchComplete received");
do_print("onSearchComplete received");
deferred.resolve();
}
@ -136,7 +136,7 @@ function* check_autocomplete(test) {
controller.startSearch(test.incompleteSearch);
expectedSearches++;
}
do_log_info("Searching for: '" + test.search + "'");
do_print("Searching for: '" + test.search + "'");
controller.startSearch(test.search);
yield deferred.promise;
@ -150,7 +150,7 @@ function* check_autocomplete(test) {
for (let i = 0; i < controller.matchCount; i++) {
let value = controller.getValueAt(i);
let comment = controller.getCommentAt(i);
do_log_info("Looking for '" + value + "', '" + comment + "' in expected results...");
do_print("Looking for '" + value + "', '" + comment + "' in expected results...");
let j;
for (j = 0; j < matches.length; j++) {
// Skip processed expected results
@ -167,10 +167,10 @@ function* check_autocomplete(test) {
else
style = ["favicon"];
do_log_info("Checking against expected '" + uri.spec + "', '" + title + "'...");
do_print("Checking against expected '" + uri.spec + "', '" + title + "'...");
// Got a match on both uri and title?
if (stripPrefix(uri.spec) == stripPrefix(value) && title == comment) {
do_log_info("Got a match at index " + j + "!");
do_print("Got a match at index " + j + "!");
let actualStyle = controller.getStyleAt(i).split(/\s+/).sort();
if (style)
Assert.equal(actualStyle.toString(), style.toString(), "Match should have expected style");
@ -254,7 +254,7 @@ function changeRestrict(aType, aChar) {
else
branch += "restrict.";
do_log_info("changing restrict for " + aType + " to '" + aChar + "'");
do_print("changing restrict for " + aType + " to '" + aChar + "'");
Services.prefs.setCharPref(branch + aType, aChar);
}

Просмотреть файл

@ -8,7 +8,7 @@
*/
add_task(function* test_tag_match_has_bookmark_title() {
do_log_info("Make sure the tag match gives the bookmark title");
do_print("Make sure the tag match gives the bookmark title");
let uri = NetUtil.newURI("http://theuri/");
yield promiseAddVisits({ uri: uri, title: "Page title" });
addBookmark({ uri: uri,

Просмотреть файл

@ -15,7 +15,7 @@
*/
add_task(function* test_tag_match_url() {
do_log_info("Make sure tag matches return the right url as well as '+' remain escaped");
do_print("Make sure tag matches return the right url as well as '+' remain escaped");
let uri1 = NetUtil.newURI("http://escaped/ユニコード");
let uri2 = NetUtil.newURI("http://asciiescaped/blocking-firefox3%2B");
yield promiseAddVisits([ { uri: uri1, title: "title" },

Просмотреть файл

@ -16,32 +16,32 @@ add_task(function* test_javascript_match() {
addBookmark({ uri: uri2,
title: "Title with javascript:" });
do_log_info("Match non-javascript: with plain search");
do_print("Match non-javascript: with plain search");
yield check_autocomplete({
search: "a",
matches: [ { uri: uri1, title: "Title with javascript:" } ]
});
do_log_info("Match non-javascript: with almost javascript:");
do_print("Match non-javascript: with almost javascript:");
yield check_autocomplete({
search: "javascript",
matches: [ { uri: uri1, title: "Title with javascript:" } ]
});
do_log_info("Match javascript:");
do_print("Match javascript:");
yield check_autocomplete({
search: "javascript:",
matches: [ { uri: uri1, title: "Title with javascript:" },
{ uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]
});
do_log_info("Match nothing with non-first javascript:");
do_print("Match nothing with non-first javascript:");
yield check_autocomplete({
search: "5 javascript:",
matches: [ ]
});
do_log_info("Match javascript: with multi-word search");
do_print("Match javascript: with multi-word search");
yield check_autocomplete({
search: "javascript: 5",
matches: [ { uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]

Просмотреть файл

@ -30,31 +30,31 @@ add_task(function* test_javascript_match() {
title: "tagged",
tags: [ "tag1", "tag2", "tag3" ] });
do_log_info("Make sure tags come back in the title when matching tags");
do_print("Make sure tags come back in the title when matching tags");
yield check_autocomplete({
search: "page1 tag",
matches: [ { uri: uri1, title: "tagged", tags: [ "tag1" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Check tags in title for page2");
do_print("Check tags in title for page2");
yield check_autocomplete({
search: "page2 tag",
matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Make sure tags appear even when not matching the tag");
do_print("Make sure tags appear even when not matching the tag");
yield check_autocomplete({
search: "page3",
matches: [ { uri: uri3, title: "tagged", tags: [ "tag1", "tag3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Multiple tags come in commas for page4");
do_print("Multiple tags come in commas for page4");
yield check_autocomplete({
search: "page4",
matches: [ { uri: uri4, title: "tagged", tags: [ "tag1", "tag2", "tag3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Extra test just to make sure we match the title");
do_print("Extra test just to make sure we match the title");
yield check_autocomplete({
search: "tag2",
matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] },

Просмотреть файл

@ -8,7 +8,7 @@
*/
add_task(function* test_javascript_match() {
do_log_info("Bad escaped uri stays escaped");
do_print("Bad escaped uri stays escaped");
let uri1 = NetUtil.newURI("http://site/%EAid");
yield promiseAddVisits([ { uri: uri1, title: "title" } ]);
yield check_autocomplete({

Просмотреть файл

@ -27,7 +27,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
do_log_info("Restrict history, common visit, should not autoFill");
do_print("Restrict history, common visit, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ { uri: uri2, title: "visited" } ],
@ -35,7 +35,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict history, typed visit, should autoFill");
do_print("Restrict history, typed visit, should autoFill");
yield check_autocomplete({
search: "ty",
matches: [ { uri: uri1, title: "typed", style: [ "autofill" ] } ],
@ -44,7 +44,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("Restrict history, bookmark, should not autoFill");
do_print("Restrict history, bookmark, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ ],
@ -53,7 +53,7 @@ add_task(function* test_default_behavior_host() {
});
// Note we don't show this one cause it's not typed.
do_log_info("Restrict history, typed bookmark, should autoFill");
do_print("Restrict history, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -66,7 +66,7 @@ add_task(function* test_default_behavior_host() {
// We are not restricting on typed, so we autoFill the bookmark even if we
// are restricted to history. We accept that cause not doing that
// would be a perf hit and the privacy implications are very weak.
do_log_info("Restrict history, bookmark, autoFill.typed = false, should autoFill");
do_print("Restrict history, bookmark, autoFill.typed = false, should autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ], style: [ "autofill" ] } ],
@ -74,7 +74,7 @@ add_task(function* test_default_behavior_host() {
completed: "bookmarked/"
});
do_log_info("Restrict history, common visit, autoFill.typed = false, should autoFill");
do_print("Restrict history, common visit, autoFill.typed = false, should autoFill");
yield check_autocomplete({
search: "vi",
matches: [ { uri: uri2, title: "visited", style: [ "autofill" ] } ],
@ -87,7 +87,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
// Typed behavior basically acts like history, but filters on typed.
do_log_info("Restrict typed, common visit, autoFill.typed = false, should not autoFill");
do_print("Restrict typed, common visit, autoFill.typed = false, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ ],
@ -95,7 +95,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict typed, typed visit, autofill.typed = false, should autoFill");
do_print("Restrict typed, typed visit, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "ty",
matches: [ { uri: uri1, title: "typed", style: [ "autofill" ] } ],
@ -103,7 +103,7 @@ add_task(function* test_default_behavior_host() {
completed: "typed/"
});
do_log_info("Restrict typed, bookmark, autofill.typed = false, should not autoFill");
do_print("Restrict typed, bookmark, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ ],
@ -111,7 +111,7 @@ add_task(function* test_default_behavior_host() {
completed: "bo"
});
do_log_info("Restrict typed, typed bookmark, autofill.typed = false, should autoFill");
do_print("Restrict typed, typed bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -124,7 +124,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
do_log_info("Restrict bookmarks, common visit, should not autoFill");
do_print("Restrict bookmarks, common visit, should not autoFill");
yield check_autocomplete({
search: "vi",
matches: [ ],
@ -132,7 +132,7 @@ add_task(function* test_default_behavior_host() {
completed: "vi"
});
do_log_info("Restrict bookmarks, typed visit, should not autoFill");
do_print("Restrict bookmarks, typed visit, should not autoFill");
yield check_autocomplete({
search: "ty",
matches: [ ],
@ -141,7 +141,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("Restrict bookmarks, bookmark, should not autoFill");
do_print("Restrict bookmarks, bookmark, should not autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ] } ],
@ -150,7 +150,7 @@ add_task(function* test_default_behavior_host() {
});
// Note we don't show this one cause it's not typed.
do_log_info("Restrict bookmarks, typed bookmark, should autoFill");
do_print("Restrict bookmarks, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tp",
matches: [ { uri: uri4, title: "tpbk", style: [ "autofill" ] } ],
@ -160,7 +160,7 @@ add_task(function* test_default_behavior_host() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
do_log_info("Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
do_print("Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "bo",
matches: [ { uri: uri3, title: "bookmarked", style: [ "autofill" ] } ],
@ -169,7 +169,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autofill because it's a title.
do_log_info("Restrict bookmarks, title, autofill.typed = false, should not autoFill");
do_print("Restrict bookmarks, title, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "# ta",
matches: [ ],
@ -178,7 +178,7 @@ add_task(function* test_default_behavior_host() {
});
// Don't autofill because it's a tag.
do_log_info("Restrict bookmarks, tag, autofill.typed = false, should not autoFill");
do_print("Restrict bookmarks, tag, autofill.typed = false, should not autoFill");
yield check_autocomplete({
search: "+ ta",
matches: [ { uri: uri5, title: "title", tags: [ "foo" ], style: [ "tag" ] } ],
@ -210,7 +210,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
do_log_info("URL: Restrict history, common visit, should not autoFill");
do_print("URL: Restrict history, common visit, should not autoFill");
yield check_autocomplete({
search: "visited/v",
matches: [ { uri: uri2, title: "visited" } ],
@ -218,7 +218,7 @@ add_task(function* test_default_behavior_url() {
completed: "visited/v"
});
do_log_info("URL: Restrict history, typed visit, should autoFill");
do_print("URL: Restrict history, typed visit, should autoFill");
yield check_autocomplete({
search: "typed/t",
matches: [ { uri: uri1, title: "typed/ty/", style: [ "autofill" ] } ],
@ -227,7 +227,7 @@ add_task(function* test_default_behavior_url() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("URL: Restrict history, bookmark, should not autoFill");
do_print("URL: Restrict history, bookmark, should not autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ ],
@ -236,7 +236,7 @@ add_task(function* test_default_behavior_url() {
});
// Note we don't show this one cause it's not typed.
do_log_info("URL: Restrict history, typed bookmark, should autoFill");
do_print("URL: Restrict history, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tpbk/t",
matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill" ] } ],
@ -248,7 +248,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
do_log_info("URL: Restrict bookmarks, common visit, should not autoFill");
do_print("URL: Restrict bookmarks, common visit, should not autoFill");
yield check_autocomplete({
search: "visited/v",
matches: [ ],
@ -256,7 +256,7 @@ add_task(function* test_default_behavior_url() {
completed: "visited/v"
});
do_log_info("URL: Restrict bookmarks, typed visit, should not autoFill");
do_print("URL: Restrict bookmarks, typed visit, should not autoFill");
yield check_autocomplete({
search: "typed/t",
matches: [ ],
@ -265,7 +265,7 @@ add_task(function* test_default_behavior_url() {
});
// Don't autoFill this one cause it's not typed.
do_log_info("URL: Restrict bookmarks, bookmark, should not autoFill");
do_print("URL: Restrict bookmarks, bookmark, should not autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ] } ],
@ -274,7 +274,7 @@ add_task(function* test_default_behavior_url() {
});
// Note we don't show this one cause it's not typed.
do_log_info("URL: Restrict bookmarks, typed bookmark, should autoFill");
do_print("URL: Restrict bookmarks, typed bookmark, should autoFill");
yield check_autocomplete({
search: "tpbk/t",
matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill" ] } ],
@ -284,7 +284,7 @@ add_task(function* test_default_behavior_url() {
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
do_log_info("URL: Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
do_print("URL: Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
yield check_autocomplete({
search: "bookmarked/b",
matches: [ { uri: uri3, title: "bookmarked/bo/", style: [ "autofill" ] } ],

Просмотреть файл

@ -7,7 +7,7 @@
const PREF_AUTOCOMPLETE_ENABLED = "browser.urlbar.autocomplete.enabled";
add_task(function* test_disabling_autocomplete() {
do_log_info("Check disabling autocomplete disables autofill");
do_print("Check disabling autocomplete disables autofill");
Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://visit.mozilla.org"),
transition: TRANSITION_TYPED });
@ -20,7 +20,7 @@ add_task(function* test_disabling_autocomplete() {
});
add_task(function* test_urls_order() {
do_log_info("Add urls, check for correct order");
do_print("Add urls, check for correct order");
let places = [{ uri: NetUtil.newURI("http://visit1.mozilla.org") },
{ uri: NetUtil.newURI("http://visit2.mozilla.org"),
transition: TRANSITION_TYPED }];
@ -34,7 +34,7 @@ add_task(function* test_urls_order() {
});
add_task(function* test_ignore_prefix() {
do_log_info("Add urls, make sure www and http are ignored");
do_print("Add urls, make sure www and http are ignored");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.visit1.mozilla.org"));
yield check_autocomplete({
@ -46,7 +46,7 @@ add_task(function* test_ignore_prefix() {
});
add_task(function* test_after_host() {
do_log_info("Autocompleting after an existing host completes to the url");
do_print("Autocompleting after an existing host completes to the url");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.visit3.mozilla.org"));
yield check_autocomplete({
@ -58,7 +58,7 @@ add_task(function* test_after_host() {
});
add_task(function* test_respect_www() {
do_log_info("Searching for www.me should yield www.me.mozilla.org/");
do_print("Searching for www.me should yield www.me.mozilla.org/");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://www.me.mozilla.org"));
yield check_autocomplete({
@ -70,7 +70,7 @@ add_task(function* test_respect_www() {
});
add_task(function* test_bookmark_first() {
do_log_info("With a bookmark and history, the query result should be the bookmark");
do_print("With a bookmark and history, the query result should be the bookmark");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
addBookmark({ uri: NetUtil.newURI("http://bookmark1.mozilla.org/") });
yield promiseAddVisits(NetUtil.newURI("http://bookmark1.mozilla.org/foo"));
@ -83,7 +83,7 @@ add_task(function* test_bookmark_first() {
});
add_task(function* test_full_path() {
do_log_info("Check to make sure we get the proper results with full paths");
do_print("Check to make sure we get the proper results with full paths");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -97,7 +97,7 @@ add_task(function* test_full_path() {
});
add_task(function* test_complete_to_slash() {
do_log_info("Check to make sure we autocomplete to the following '/'");
do_print("Check to make sure we autocomplete to the following '/'");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -111,7 +111,7 @@ add_task(function* test_complete_to_slash() {
});
add_task(function* test_complete_to_slash_with_www() {
do_log_info("Check to make sure we autocomplete to the following '/'");
do_print("Check to make sure we autocomplete to the following '/'");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
let places = [{ uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
{ uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
@ -125,7 +125,7 @@ add_task(function* test_complete_to_slash_with_www() {
});
add_task(function* test_complete_querystring() {
do_log_info("Check to make sure we autocomplete after ?");
do_print("Check to make sure we autocomplete after ?");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious"));
yield check_autocomplete({
@ -137,7 +137,7 @@ add_task(function* test_complete_querystring() {
});
add_task(function* test_complete_fragment() {
do_log_info("Check to make sure we autocomplete after #");
do_print("Check to make sure we autocomplete after #");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious#bar"));
yield check_autocomplete({

Просмотреть файл

@ -6,7 +6,7 @@ add_task(function* test_prefix_space_noautofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill if search string contains a space");
do_print("Should not try to autoFill if search string contains a space");
yield check_autocomplete({
search: " mo",
autofilled: " mo",
@ -20,7 +20,7 @@ add_task(function* test_trailing_space_noautofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill if search string contains a space");
do_print("Should not try to autoFill if search string contains a space");
yield check_autocomplete({
search: "mo ",
autofilled: "mo ",
@ -38,7 +38,7 @@ add_task(function* test_searchEngine_autofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should autoFill search engine if search string does not contains a space");
do_print("Should autoFill search engine if search string does not contains a space");
yield check_autocomplete({
search: "ca",
autofilled: "cake.search",
@ -56,7 +56,7 @@ add_task(function* test_searchEngine_prefix_space_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not try to autoFill search engine if search string contains a space");
do_print("Should not try to autoFill search engine if search string contains a space");
yield check_autocomplete({
search: " cu",
autofilled: " cu",
@ -74,7 +74,7 @@ add_task(function* test_searchEngine_trailing_space_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not try to autoFill search engine if search string contains a space");
do_print("Should not try to autoFill search engine if search string contains a space");
yield check_autocomplete({
search: "ba ",
autofilled: "ba ",
@ -92,7 +92,7 @@ add_task(function* test_searchEngine_www_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not autoFill search engine if search string contains www. but engine doesn't");
do_print("Should not autoFill search engine if search string contains www. but engine doesn't");
yield check_autocomplete({
search: "www.ham",
autofilled: "www.ham",
@ -110,7 +110,7 @@ add_task(function* test_searchEngine_different_scheme_noautofill() {
engine.addParam("q", "{searchTerms}", null);
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should not autoFill search engine if search string has a different scheme.");
do_print("Should not autoFill search engine if search string has a different scheme.");
yield check_autocomplete({
search: "http://pie",
autofilled: "http://pie",
@ -129,21 +129,21 @@ add_task(function* test_searchEngine_matching_prefix_autofill() {
do_register_cleanup(() => Services.search.removeEngine(engine));
do_log_info("Should autoFill search engine if search string has matching prefix.");
do_print("Should autoFill search engine if search string has matching prefix.");
yield check_autocomplete({
search: "http://www.be",
autofilled: "http://www.bean.search",
completed: "http://www.bean.search"
})
do_log_info("Should autoFill search engine if search string has www prefix.");
do_print("Should autoFill search engine if search string has www prefix.");
yield check_autocomplete({
search: "www.be",
autofilled: "www.bean.search",
completed: "http://www.bean.search"
});
do_log_info("Should autoFill search engine if search string has matching scheme.");
do_print("Should autoFill search engine if search string has matching scheme.");
yield check_autocomplete({
search: "http://be",
autofilled: "http://bean.search",
@ -159,7 +159,7 @@ add_task(function* test_prefix_autofill() {
yield promiseAddVisits({ uri: NetUtil.newURI("http://moz.org/test/"),
transition: TRANSITION_TYPED });
do_log_info("Should not try to autoFill in-the-middle if a search is canceled immediately");
do_print("Should not try to autoFill in-the-middle if a search is canceled immediately");
yield check_autocomplete({
incompleteSearch: "moz",
search: "mozi",

Просмотреть файл

@ -28,7 +28,7 @@ add_task(function* test_protocol_trimming() {
"www.mo te"
];
for (let input of inputs) {
do_log_info("Searching for: " + input);
do_print("Searching for: " + input);
yield check_autocomplete({
search: input,
matches: matches

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_casing_1() {
do_log_info("Searching for cased entry 1");
do_print("Searching for cased entry 1");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -15,7 +15,7 @@ add_task(function* test_casing_1() {
});
add_task(function* test_casing_2() {
do_log_info("Searching for cased entry 2");
do_print("Searching for cased entry 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -27,7 +27,7 @@ add_task(function* test_casing_2() {
});
add_task(function* test_casing_3() {
do_log_info("Searching for cased entry 3");
do_print("Searching for cased entry 3");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -39,7 +39,7 @@ add_task(function* test_casing_3() {
});
add_task(function* test_casing_4() {
do_log_info("Searching for cased entry 4");
do_print("Searching for cased entry 4");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -51,7 +51,7 @@ add_task(function* test_casing_4() {
});
add_task(function* test_casing_5() {
do_log_info("Searching for cased entry 5");
do_print("Searching for cased entry 5");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -63,7 +63,7 @@ add_task(function* test_casing_5() {
});
add_task(function* test_untrimmed_casing() {
do_log_info("Searching for untrimmed cased entry");
do_print("Searching for untrimmed cased entry");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -75,7 +75,7 @@ add_task(function* test_untrimmed_casing() {
});
add_task(function* test_untrimmed_www_casing() {
do_log_info("Searching for untrimmed cased entry with www");
do_print("Searching for untrimmed cased entry with www");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -87,7 +87,7 @@ add_task(function* test_untrimmed_www_casing() {
});
add_task(function* test_untrimmed_path_casing() {
do_log_info("Searching for untrimmed cased entry with path");
do_print("Searching for untrimmed cased entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -99,7 +99,7 @@ add_task(function* test_untrimmed_path_casing() {
});
add_task(function* test_untrimmed_path_casing_2() {
do_log_info("Searching for untrimmed cased entry with path 2");
do_print("Searching for untrimmed cased entry with path 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -111,7 +111,7 @@ add_task(function* test_untrimmed_path_casing_2() {
});
add_task(function* test_untrimmed_path_www_casing() {
do_log_info("Searching for untrimmed cased entry with www and path");
do_print("Searching for untrimmed cased entry with www and path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -123,7 +123,7 @@ add_task(function* test_untrimmed_path_www_casing() {
});
add_task(function* test_untrimmed_path_www_casing_2() {
do_log_info("Searching for untrimmed cased entry with www and path 2");
do_print("Searching for untrimmed cased entry with www and path 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

Просмотреть файл

@ -6,7 +6,7 @@
// that largely confuses completeDefaultIndex
add_task(function* test_not_autofill_ws_1() {
do_log_info("Do not autofill whitespaced entry 1");
do_print("Do not autofill whitespaced entry 1");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -18,7 +18,7 @@ add_task(function* test_not_autofill_ws_1() {
});
add_task(function* test_not_autofill_ws_2() {
do_log_info("Do not autofill whitespaced entry 2");
do_print("Do not autofill whitespaced entry 2");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -30,7 +30,7 @@ add_task(function* test_not_autofill_ws_2() {
});
add_task(function* test_not_autofill_ws_3() {
do_log_info("Do not autofill whitespaced entry 3");
do_print("Do not autofill whitespaced entry 3");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -42,7 +42,7 @@ add_task(function* test_not_autofill_ws_3() {
});
add_task(function* test_not_autofill_ws_4() {
do_log_info("Do not autofill whitespaced entry 4");
do_print("Do not autofill whitespaced entry 4");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -55,7 +55,7 @@ add_task(function* test_not_autofill_ws_4() {
add_task(function* test_not_autofill_ws_5() {
do_log_info("Do not autofill whitespaced entry 5");
do_print("Do not autofill whitespaced entry 5");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -67,7 +67,7 @@ add_task(function* test_not_autofill_ws_5() {
});
add_task(function* test_not_autofill_ws_6() {
do_log_info("Do not autofill whitespaced entry 6");
do_print("Do not autofill whitespaced entry 6");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

Просмотреть файл

@ -35,37 +35,37 @@ add_task(function* test_download_embed_bookmarks() {
addBookmark({ uri: uri3,
title: "framed-bookmark" });
do_log_info("Searching for bookmarked download uri matches");
do_print("Searching for bookmarked download uri matches");
yield check_autocomplete({
search: "download-bookmark",
matches: [ { uri: uri1, title: "download-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for bookmarked embed uri matches");
do_print("Searching for bookmarked embed uri matches");
yield check_autocomplete({
search: "embed-bookmark",
matches: [ { uri: uri2, title: "embed-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for bookmarked framed uri matches");
do_print("Searching for bookmarked framed uri matches");
yield check_autocomplete({
search: "framed-bookmark",
matches: [ { uri: uri3, title: "framed-bookmark", style: [ "bookmark" ] } ]
});
do_log_info("Searching for download uri does not match");
do_print("Searching for download uri does not match");
yield check_autocomplete({
search: "download2",
matches: [ ]
});
do_log_info("Searching for embed uri does not match");
do_print("Searching for embed uri does not match");
yield check_autocomplete({
search: "embed2",
matches: [ ]
});
do_log_info("Searching for framed uri does not match");
do_print("Searching for framed uri does not match");
yield check_autocomplete({
search: "framed2",
matches: [ ]

Просмотреть файл

@ -4,7 +4,7 @@
// Ensure inline autocomplete doesn't return zero frecency pages.
add_task(function* test_dupe_urls() {
do_log_info("Searching for urls with dupes should only show one");
do_print("Searching for urls with dupes should only show one");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://mozilla.org/?") });

Просмотреть файл

@ -40,7 +40,7 @@ add_task(function* test_javascript_match() {
// Now remove page 6 from history, so it is an unvisited bookmark.
PlacesUtils.history.removePage(uri6);
do_log_info("Match everything");
do_print("Match everything");
yield check_autocomplete({
search: "foo",
searchParam: "enable-actions",
@ -53,21 +53,21 @@ add_task(function* test_javascript_match() {
{ uri: makeActionURI("switchtab", {url: "http://t.foo/6"}), title: "title", style: [ "action,switchtab" ] }, ]
});
do_log_info("Match only typed history");
do_print("Match only typed history");
yield check_autocomplete({
search: "foo ^ ~",
matches: [ { uri: uri3, title: "title" },
{ uri: uri4, title: "title" } ]
});
do_log_info("Drop-down empty search matches only typed history");
do_print("Drop-down empty search matches only typed history");
yield check_autocomplete({
search: "",
matches: [ { uri: uri3, title: "title" },
{ uri: uri4, title: "title" } ]
});
do_log_info("Drop-down empty search matches only bookmarks");
do_print("Drop-down empty search matches only bookmarks");
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
yield check_autocomplete({
@ -78,7 +78,7 @@ add_task(function* test_javascript_match() {
{ uri: uri6, title: "title", style: ["bookmark"] } ]
});
do_log_info("Drop-down empty search matches only open tabs");
do_print("Drop-down empty search matches only open tabs");
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
yield check_autocomplete({
search: "",

Просмотреть файл

@ -11,20 +11,20 @@ add_task(function* test_enabled() {
let uri = NetUtil.newURI("http://url/0");
yield promiseAddVisits([ { uri: uri, title: "title" } ]);
do_log_info("plain search");
do_print("plain search");
yield check_autocomplete({
search: "url",
matches: [ { uri: uri, title: "title" } ]
});
do_log_info("search disabled");
do_print("search disabled");
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false);
yield check_autocomplete({
search: "url",
matches: [ ]
});
do_log_info("resume normal search");
do_print("resume normal search");
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
yield check_autocomplete({
search: "url",

Просмотреть файл

@ -13,13 +13,13 @@ add_task(function* test_escape() {
yield promiseAddVisits([ { uri: uri1, title: "title" },
{ uri: uri2, title: "title" } ]);
do_log_info("Unescaped location matches itself");
do_print("Unescaped location matches itself");
yield check_autocomplete({
search: "http://unescapeduri/",
matches: [ { uri: uri1, title: "title" } ]
});
do_log_info("Escaped location matches itself");
do_print("Escaped location matches itself");
yield check_autocomplete({
search: "http://escapeduri/%40/",
matches: [ { uri: uri2, title: "title" } ]

Просмотреть файл

@ -12,7 +12,7 @@ add_task(function* test_escape() {
yield promiseAddVisits([ { uri: uri1, title: "title" },
{ uri: uri2, title: "title" } ]);
do_log_info("Searching for h matches site and not http://");
do_print("Searching for h matches site and not http://");
yield check_autocomplete({
search: "h",
matches: [ { uri: uri2, title: "title" } ]

Просмотреть файл

@ -19,43 +19,43 @@ add_task(function* test_keyword_searc() {
{ uri: uri2, title: "Generic page title" } ]);
addBookmark({ uri: uri1, title: "Keyword title", keyword: "key"});
do_log_info("Plain keyword query");
do_print("Plain keyword query");
yield check_autocomplete({
search: "key term",
matches: [ { uri: NetUtil.newURI("http://abc/?search=term"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Multi-word keyword query");
do_print("Multi-word keyword query");
yield check_autocomplete({
search: "key multi word",
matches: [ { uri: NetUtil.newURI("http://abc/?search=multi+word"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword query with +");
do_print("Keyword query with +");
yield check_autocomplete({
search: "key blocking+",
matches: [ { uri: NetUtil.newURI("http://abc/?search=blocking%2B"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Unescaped term in query");
do_print("Unescaped term in query");
yield check_autocomplete({
search: "key ユニコード",
matches: [ { uri: NetUtil.newURI("http://abc/?search=ユニコード"), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword that happens to match a page");
do_print("Keyword that happens to match a page");
yield check_autocomplete({
search: "key ThisPageIsInHistory",
matches: [ { uri: NetUtil.newURI("http://abc/?search=ThisPageIsInHistory"), title: "Generic page title", style: ["bookmark"] } ]
});
do_log_info("Keyword without query (without space)");
do_print("Keyword without query (without space)");
yield check_autocomplete({
search: "key",
matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "Keyword title", style: ["keyword"] } ]
});
do_log_info("Keyword without query (with space)");
do_print("Keyword without query (with space)");
yield check_autocomplete({
search: "key ",
matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "Keyword title", style: ["keyword"] } ]
@ -66,7 +66,7 @@ add_task(function* test_keyword_searc() {
yield promiseAddVisits([ { uri: uri3, title: "Generic page title" } ]);
addBookmark({ uri: uri3, title: "Keyword title", keyword: "key", style: ["keyword"] });
do_log_info("Two keywords matched");
do_print("Two keywords matched");
yield check_autocomplete({
search: "key twoKey",
matches: [ { uri: NetUtil.newURI("http://abc/?search=twoKey"), title: "Keyword title", style: ["keyword"] },

Просмотреть файл

@ -19,49 +19,49 @@ add_task(function* test_keyword_search() {
{ uri: uri2, title: "Generic page title" } ]);
addBookmark({ uri: uri1, title: "Keyword title", keyword: "key"});
do_log_info("Plain keyword query");
do_print("Plain keyword query");
yield check_autocomplete({
search: "key term",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=term", input: "key term"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Multi-word keyword query");
do_print("Multi-word keyword query");
yield check_autocomplete({
search: "key multi word",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=multi+word", input: "key multi word"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword query with +");
do_print("Keyword query with +");
yield check_autocomplete({
search: "key blocking+",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=blocking%2B", input: "key blocking+"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Unescaped term in query");
do_print("Unescaped term in query");
yield check_autocomplete({
search: "key ユニコード",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=ユニコード", input: "key ユニコード"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword that happens to match a page");
do_print("Keyword that happens to match a page");
yield check_autocomplete({
search: "key ThisPageIsInHistory",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=ThisPageIsInHistory", input: "key ThisPageIsInHistory"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword without query (without space)");
do_print("Keyword without query (without space)");
yield check_autocomplete({
search: "key",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=", input: "key"}), title: "Keyword title", style: [ "action", "keyword" ] } ]
});
do_log_info("Keyword without query (with space)");
do_print("Keyword without query (with space)");
yield check_autocomplete({
search: "key ",
searchParam: "enable-actions",
@ -73,7 +73,7 @@ add_task(function* test_keyword_search() {
yield promiseAddVisits([ { uri: uri3, title: "Generic page title" } ]);
addBookmark({ uri: uri3, title: "Keyword title", keyword: "key"});
do_log_info("Two keywords matched");
do_print("Two keywords matched");
yield check_autocomplete({
search: "key twoKey",
searchParam: "enable-actions",

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_non_keyword() {
do_log_info("Searching for non-keyworded entry should autoFill it");
do_print("Searching for non-keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/") });
@ -16,7 +16,7 @@ add_task(function* test_non_keyword() {
});
add_task(function* test_keyword() {
do_log_info("Searching for keyworded entry should not autoFill it");
do_print("Searching for keyworded entry should not autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -29,7 +29,7 @@ add_task(function* test_keyword() {
});
add_task(function* test_more_than_keyword() {
do_log_info("Searching for more than keyworded entry should autoFill it");
do_print("Searching for more than keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -42,7 +42,7 @@ add_task(function* test_more_than_keyword() {
});
add_task(function* test_less_than_keyword() {
do_log_info("Searching for less than keyworded entry should autoFill it");
do_print("Searching for less than keyworded entry should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
@ -55,7 +55,7 @@ add_task(function* test_less_than_keyword() {
});
add_task(function* test_keyword_casing() {
do_log_info("Searching for keyworded entry is case-insensitive");
do_print("Searching for keyworded entry is case-insensitive");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/test/"),
transition: TRANSITION_TYPED });
addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });

Просмотреть файл

@ -15,32 +15,32 @@ add_task(function* test_match_beginning() {
yield promiseAddVisits([ { uri: uri1, title: "a b" },
{ uri: uri2, title: "b a" } ]);
do_log_info("Match at the beginning of titles");
do_print("Match at the beginning of titles");
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 3);
yield check_autocomplete({
search: "a",
matches: [ { uri: uri1, title: "a b" } ]
});
do_log_info("Match at the beginning of titles");
do_print("Match at the beginning of titles");
yield check_autocomplete({
search: "b",
matches: [ { uri: uri2, title: "b a" } ]
});
do_log_info("Match at the beginning of urls");
do_print("Match at the beginning of urls");
yield check_autocomplete({
search: "x",
matches: [ { uri: uri1, title: "a b" } ]
});
do_log_info("Match at the beginning of urls");
do_print("Match at the beginning of urls");
yield check_autocomplete({
search: "y",
matches: [ { uri: uri2, title: "b a" } ]
});
do_log_info("Sanity check that matching anywhere finds more");
do_print("Sanity check that matching anywhere finds more");
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 1);
yield check_autocomplete({
search: "a",

Просмотреть файл

@ -24,39 +24,39 @@ add_task(function* test_match_beginning() {
addBookmark({ uri: uri3, title: "f(o)o b<a>r" });
addBookmark({ uri: uri4, title: "b(a)r b<a>z" });
do_log_info("Match 2 terms all in url");
do_print("Match 2 terms all in url");
yield check_autocomplete({
search: "c d",
matches: [ { uri: uri1, title: "f(o)o b<a>r" } ]
});
do_log_info("Match 1 term in url and 1 term in title");
do_print("Match 1 term in url and 1 term in title");
yield check_autocomplete({
search: "b e",
matches: [ { uri: uri1, title: "f(o)o b<a>r" },
{ uri: uri2, title: "b(a)r b<a>z" } ]
});
do_log_info("Match 3 terms all in title; display bookmark title if matched");
do_print("Match 3 terms all in title; display bookmark title if matched");
yield check_autocomplete({
search: "b a z",
matches: [ { uri: uri2, title: "b(a)r b<a>z" },
{ uri: uri4, title: "b(a)r b<a>z", style: [ "bookmark" ] } ]
});
do_log_info("Match 2 terms in url and 1 in title; make sure bookmark title is used for search");
do_print("Match 2 terms in url and 1 in title; make sure bookmark title is used for search");
yield check_autocomplete({
search: "k f t",
matches: [ { uri: uri3, title: "f(o)o b<a>r", style: [ "bookmark" ] } ]
});
do_log_info("Match 3 terms in url and 1 in title");
do_print("Match 3 terms in url and 1 in title");
yield check_autocomplete({
search: "d i g z",
matches: [ { uri: uri2, title: "b(a)r b<a>z" } ]
});
do_log_info("Match nothing");
do_print("Match nothing");
yield check_autocomplete({
search: "m o z i",
matches: [ ]

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_no_slash() {
do_log_info("Searching for host match without slash should match host");
do_print("Searching for host match without slash should match host");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -17,7 +17,7 @@ add_task(function* test_no_slash() {
});
add_task(function* test_w_slash() {
do_log_info("Searching match with slash at the end should do nothing");
do_print("Searching match with slash at the end should do nothing");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -31,7 +31,7 @@ add_task(function* test_w_slash() {
});
add_task(function* test_middle() {
do_log_info("Searching match with slash in the middle should match url");
do_print("Searching match with slash in the middle should match url");
yield promiseAddVisits({ uri: NetUtil.newURI("http://file.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("file:///c:/test.html"),
@ -45,7 +45,7 @@ add_task(function* test_middle() {
});
add_task(function* test_nonhost() {
do_log_info("Searching for non-host match without slash should not match url");
do_print("Searching for non-host match without slash should not match url");
yield promiseAddVisits({ uri: NetUtil.newURI("file:///c:/test.html"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

Просмотреть файл

@ -10,28 +10,28 @@ add_task(function*() {
Services.search.addEngineWithDetails("AliasedMozSearch", "", "doit", "",
"GET", "http://s.example.com/search");
do_log_info("search engine");
do_print("search engine");
yield check_autocomplete({
search: "mozilla",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "mozilla", searchQuery: "mozilla"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, uri-like input");
do_print("search engine, uri-like input");
yield check_autocomplete({
search: "http:///",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "http:///", searchQuery: "http:///"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, multiple words");
do_print("search engine, multiple words");
yield check_autocomplete({
search: "mozzarella cheese",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "mozzarella cheese", searchQuery: "mozzarella cheese"}), title: "MozSearch", style: [ "action", "searchengine" ] }, ]
});
do_log_info("search engine, after current engine has changed");
do_print("search engine, after current engine has changed");
Services.search.addEngineWithDetails("MozSearch2", "", "", "", "GET",
"http://s.example.com/search2");
engine = Services.search.getEngineByName("MozSearch2");

Просмотреть файл

@ -55,7 +55,7 @@ add_task(function* test_searchEngine_autoFill() {
yield promiseAsyncUpdates();
ok(frecencyForUrl(uri) > 10000, "Added URI should have expected high frecency");
do_log_info("Check search domain is autoFilled even if there's an higher frecency match");
do_print("Check search domain is autoFilled even if there's an higher frecency match");
yield check_autocomplete({
search: "my",
autofilled: "my.search.com",

Просмотреть файл

@ -14,7 +14,7 @@ add_task(function* test_searchEngine() {
yield promiseAddVisits({ uri: uri1, title: "Terms - SearchEngine Search" });
addBookmark({ uri: uri2, title: "Terms - SearchEngine Search" });
do_log_info("Past search terms should be styled, unless bookmarked");
do_print("Past search terms should be styled, unless bookmarked");
Services.prefs.setBoolPref("browser.urlbar.restyleSearches", true);
yield check_autocomplete({
search: "term",
@ -22,7 +22,7 @@ add_task(function* test_searchEngine() {
{ uri: uri2, title: "Terms - SearchEngine Search", style: ["bookmark"] } ]
});
do_log_info("Past search terms should not be styled if restyling is disabled");
do_print("Past search terms should not be styled if restyling is disabled");
Services.prefs.setBoolPref("browser.urlbar.restyleSearches", false);
yield check_autocomplete({
search: "term",

Просмотреть файл

@ -45,7 +45,7 @@ add_task(function* test_special_searches() {
addBookmark( { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ] } );
// Test restricting searches
do_log_info("History restrict");
do_print("History restrict");
yield check_autocomplete({
search: "^",
matches: [ { uri: uri1, title: "title" },
@ -56,7 +56,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Star restrict");
do_print("Star restrict");
yield check_autocomplete({
search: "*",
matches: [ { uri: uri5, title: "title", style: [ "bookmark" ] },
@ -69,7 +69,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Tag restrict");
do_print("Tag restrict");
yield check_autocomplete({
search: "+",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
@ -79,7 +79,7 @@ add_task(function* test_special_searches() {
});
// Test specials as any word position
do_log_info("Special as first word");
do_print("Special as first word");
yield check_autocomplete({
search: "^ foo bar",
matches: [ { uri: uri2, title: "foo.bar" },
@ -89,7 +89,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Special as middle word");
do_print("Special as middle word");
yield check_autocomplete({
search: "foo ^ bar",
matches: [ { uri: uri2, title: "foo.bar" },
@ -99,7 +99,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("Special as last word");
do_print("Special as last word");
yield check_autocomplete({
search: "foo bar ^",
matches: [ { uri: uri2, title: "foo.bar" },
@ -110,7 +110,7 @@ add_task(function* test_special_searches() {
});
// Test restricting and matching searches with a term
do_log_info("foo ^ -> history");
do_print("foo ^ -> history");
yield check_autocomplete({
search: "foo ^",
matches: [ { uri: uri2, title: "foo.bar" },
@ -120,7 +120,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> history (change pref)");
do_print("foo | -> history (change pref)");
changeRestrict("history", "|");
yield check_autocomplete({
search: "foo |",
@ -131,7 +131,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo * -> is star");
do_print("foo * -> is star");
resetRestrict("history");
yield check_autocomplete({
search: "foo *",
@ -144,7 +144,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo | -> is star (change pref)");
do_print("foo | -> is star (change pref)");
changeRestrict("bookmark", "|");
yield check_autocomplete({
search: "foo |",
@ -157,7 +157,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo # -> in title");
do_print("foo # -> in title");
resetRestrict("bookmark");
yield check_autocomplete({
search: "foo #",
@ -171,7 +171,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> in title (change pref)");
do_print("foo | -> in title (change pref)");
changeRestrict("title", "|");
yield check_autocomplete({
search: "foo |",
@ -185,7 +185,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ -> in url");
do_print("foo @ -> in url");
resetRestrict("title");
yield check_autocomplete({
search: "foo @",
@ -197,7 +197,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> in url (change pref)");
do_print("foo | -> in url (change pref)");
changeRestrict("url", "|");
yield check_autocomplete({
search: "foo |",
@ -209,7 +209,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo + -> is tag");
do_print("foo + -> is tag");
resetRestrict("url");
yield check_autocomplete({
search: "foo +",
@ -219,7 +219,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> is tag (change pref)");
do_print("foo | -> is tag (change pref)");
changeRestrict("tag", "|");
yield check_autocomplete({
search: "foo |",
@ -229,7 +229,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ~ -> is typed");
do_print("foo ~ -> is typed");
resetRestrict("tag");
yield check_autocomplete({
search: "foo ~",
@ -237,7 +237,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo | -> is typed (change pref)");
do_print("foo | -> is typed (change pref)");
changeRestrict("typed", "|");
yield check_autocomplete({
search: "foo |",
@ -246,7 +246,7 @@ add_task(function* test_special_searches() {
});
// Test various pairs of special searches
do_log_info("foo ^ * -> history, is star");
do_print("foo ^ * -> history, is star");
resetRestrict("typed");
yield check_autocomplete({
search: "foo ^ *",
@ -254,7 +254,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo ^ # -> history, in title");
do_print("foo ^ # -> history, in title");
yield check_autocomplete({
search: "foo ^ #",
matches: [ { uri: uri2, title: "foo.bar" },
@ -263,7 +263,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ @ -> history, in url");
do_print("foo ^ @ -> history, in url");
yield check_autocomplete({
search: "foo ^ @",
matches: [ { uri: uri3, title: "title" },
@ -271,20 +271,20 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ + -> history, is tag");
do_print("foo ^ + -> history, is tag");
yield check_autocomplete({
search: "foo ^ +",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo ^ ~ -> history, is typed");
do_print("foo ^ ~ -> history, is typed");
yield check_autocomplete({
search: "foo ^ ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo * # -> is star, in title");
do_print("foo * # -> is star, in title");
yield check_autocomplete({
search: "foo * #",
matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
@ -295,7 +295,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * @ -> is star, in url");
do_print("foo * @ -> is star, in url");
yield check_autocomplete({
search: "foo * @",
matches: [ { uri: uri7, title: "title", style: [ "bookmark" ] },
@ -304,7 +304,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * + -> same as +");
do_print("foo * + -> same as +");
yield check_autocomplete({
search: "foo * +",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
@ -313,13 +313,13 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo * ~ -> is star, is typed");
do_print("foo * ~ -> is star, is typed");
yield check_autocomplete({
search: "foo * ~",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo # @ -> in title, in url");
do_print("foo # @ -> in title, in url");
yield check_autocomplete({
search: "foo # @",
matches: [ { uri: uri4, title: "foo.bar" },
@ -328,7 +328,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo # + -> in title, is tag");
do_print("foo # + -> in title, is tag");
yield check_autocomplete({
search: "foo # +",
matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
@ -337,28 +337,28 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo # ~ -> in title, is typed");
do_print("foo # ~ -> in title, is typed");
yield check_autocomplete({
search: "foo # ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ + -> in url, is tag");
do_print("foo @ + -> in url, is tag");
yield check_autocomplete({
search: "foo @ +",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo @ ~ -> in url, is typed");
do_print("foo @ ~ -> in url, is typed");
yield check_autocomplete({
search: "foo @ ~",
matches: [ { uri: uri4, title: "foo.bar" },
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
});
do_log_info("foo + ~ -> is tag, is typed");
do_print("foo + ~ -> is tag, is typed");
yield check_autocomplete({
search: "foo + ~",
matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
@ -369,7 +369,7 @@ add_task(function* test_special_searches() {
Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
// Test default usage by setting certain browser.urlbar.suggest.* prefs
do_log_info("foo -> default history");
do_print("foo -> default history");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
yield check_autocomplete({
@ -381,7 +381,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: ["foo.bar"], style: [ "tag" ] } ]
});
do_log_info("foo -> default history, is star");
do_print("foo -> default history, is star");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
@ -399,7 +399,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> default history, is star, is typed");
do_print("foo -> default history, is star, is typed");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
@ -410,7 +410,7 @@ add_task(function* test_special_searches() {
{ uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> is star");
do_print("foo -> is star");
setSuggestPrefsToFalse();
Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
@ -425,7 +425,7 @@ add_task(function* test_special_searches() {
{ uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("foo -> is star, is typed");
do_print("foo -> is star, is typed");
setSuggestPrefsToFalse();
// only typed should be ignored
Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);

Просмотреть файл

@ -42,106 +42,106 @@ add_task(function* test_swap_protocol() {
Services.prefs.setBoolPref("browser.urlbar.autoFill", "false");
Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
do_log_info("http://www.site matches all site");
do_print("http://www.site matches all site");
yield check_autocomplete({
search: "http://www.site",
matches: allMatches
});
do_log_info("http://site matches all site");
do_print("http://site matches all site");
yield check_autocomplete({
search: "http://site",
matches: allMatches
});
do_log_info("ftp://ftp.site matches itself");
do_print("ftp://ftp.site matches itself");
yield check_autocomplete({
search: "ftp://ftp.site",
matches: [ { uri: uri3, title: "title" } ]
});
do_log_info("ftp://site matches all site");
do_print("ftp://site matches all site");
yield check_autocomplete({
search: "ftp://site",
matches: allMatches
});
do_log_info("https://www.site matches all site");
do_print("https://www.site matches all site");
yield check_autocomplete({
search: "https://www.site",
matches: allMatches
});
do_log_info("https://site matches all site");
do_print("https://site matches all site");
yield check_autocomplete({
search: "https://site",
matches: allMatches
});
do_log_info("www.site matches all site");
do_print("www.site matches all site");
yield check_autocomplete({
search: "www.site",
matches: allMatches
});
do_log_info("w matches none of www.");
do_print("w matches none of www.");
yield check_autocomplete({
search: "w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("http://w matches none of www.");
do_print("http://w matches none of www.");
yield check_autocomplete({
search: "http://w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("http://w matches none of www.");
do_print("http://w matches none of www.");
yield check_autocomplete({
search: "http://www.w",
matches: [ { uri: uri7, title: "title" },
{ uri: uri8, title: "title" } ]
});
do_log_info("ww matches none of www.");
do_print("ww matches none of www.");
yield check_autocomplete({
search: "ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("ww matches none of www.");
do_print("ww matches none of www.");
yield check_autocomplete({
search: "ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://ww matches none of www.");
do_print("http://ww matches none of www.");
yield check_autocomplete({
search: "http://ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www.ww matches none of www.");
do_print("http://www.ww matches none of www.");
yield check_autocomplete({
search: "http://www.ww",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("www matches none of www.");
do_print("www matches none of www.");
yield check_autocomplete({
search: "www",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www matches none of www.");
do_print("http://www matches none of www.");
yield check_autocomplete({
search: "http://www",
matches: [ { uri: uri8, title: "title" } ]
});
do_log_info("http://www.www matches none of www.");
do_print("http://www.www matches none of www.");
yield check_autocomplete({
search: "http://www.www",
matches: [ { uri: uri8, title: "title" } ]

Просмотреть файл

@ -23,7 +23,7 @@ add_task(function* test_tab_matches() {
addOpenPages(uri3, 1);
addOpenPages(uri4, 1);
do_log_info("two results, normal result is a tab match");
do_print("two results, normal result is a tab match");
yield check_autocomplete({
search: "abc.com",
searchParam: "enable-actions",
@ -31,7 +31,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://abc.com/"}), title: "ABC rocks", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, one tab match");
do_print("three results, one tab match");
yield check_autocomplete({
search: "abc",
searchParam: "enable-actions",
@ -40,7 +40,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("three results, both normal results are tab matches");
do_print("three results, both normal results are tab matches");
addOpenPages(uri2, 1);
yield check_autocomplete({
search: "abc",
@ -50,7 +50,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://xyz.net/"}), title: "xyz.net - we're better than ABC", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, both normal results are tab matches, one has multiple tabs");
do_print("three results, both normal results are tab matches, one has multiple tabs");
addOpenPages(uri2, 5);
yield check_autocomplete({
search: "abc",
@ -60,7 +60,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://xyz.net/"}), title: "xyz.net - we're better than ABC", style: [ "action", "switchtab" ] } ]
});
do_log_info("three results, no tab matches (disable-private-actions)");
do_print("three results, no tab matches (disable-private-actions)");
yield check_autocomplete({
search: "abc",
searchParam: "enable-actions disable-private-actions",
@ -69,7 +69,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("two results (actions disabled)");
do_print("two results (actions disabled)");
yield check_autocomplete({
search: "abc",
searchParam: "",
@ -77,7 +77,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("three results, no tab matches");
do_print("three results, no tab matches");
removeOpenPages(uri1, 1);
removeOpenPages(uri2, 6);
yield check_autocomplete({
@ -88,7 +88,7 @@ add_task(function* test_tab_matches() {
{ uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_log_info("tab match search with restriction character");
do_print("tab match search with restriction character");
addOpenPages(uri1, 1);
yield check_autocomplete({
search: gTabRestrictChar + " abc",
@ -97,7 +97,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "http://abc.com/"}), title: "ABC rocks", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages");
do_print("tab match with not-addable pages");
yield check_autocomplete({
search: "mozilla",
searchParam: "enable-actions",
@ -105,7 +105,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "about:mozilla"}), title: "about:mozilla", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages and restriction character");
do_print("tab match with not-addable pages and restriction character");
yield check_autocomplete({
search: gTabRestrictChar + " mozilla",
searchParam: "enable-actions",
@ -113,7 +113,7 @@ add_task(function* test_tab_matches() {
{ uri: makeActionURI("switchtab", {url: "about:mozilla"}), title: "about:mozilla", style: [ "action", "switchtab" ] } ]
});
do_log_info("tab match with not-addable pages and only restriction character");
do_print("tab match with not-addable pages and only restriction character");
yield check_autocomplete({
search: gTabRestrictChar,
searchParam: "enable-actions",

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test_untrimmed_secure_www() {
do_log_info("Searching for untrimmed https://www entry");
do_print("Searching for untrimmed https://www entry");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -15,7 +15,7 @@ add_task(function* test_untrimmed_secure_www() {
});
add_task(function* test_untrimmed_secure_www_path() {
do_log_info("Searching for untrimmed https://www entry with path");
do_print("Searching for untrimmed https://www entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -27,7 +27,7 @@ add_task(function* test_untrimmed_secure_www_path() {
});
add_task(function* test_untrimmed_secure() {
do_log_info("Searching for untrimmed https:// entry");
do_print("Searching for untrimmed https:// entry");
yield promiseAddVisits({ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -39,7 +39,7 @@ add_task(function* test_untrimmed_secure() {
});
add_task(function* test_untrimmed_secure_path() {
do_log_info("Searching for untrimmed https:// entry with path");
do_print("Searching for untrimmed https:// entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -51,7 +51,7 @@ add_task(function* test_untrimmed_secure_path() {
});
add_task(function* test_untrimmed_www() {
do_log_info("Searching for untrimmed http://www entry");
do_print("Searching for untrimmed http://www entry");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -63,7 +63,7 @@ add_task(function* test_untrimmed_www() {
});
add_task(function* test_untrimmed_www_path() {
do_log_info("Searching for untrimmed http://www entry with path");
do_print("Searching for untrimmed http://www entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -75,7 +75,7 @@ add_task(function* test_untrimmed_www_path() {
});
add_task(function* test_untrimmed_ftp() {
do_log_info("Searching for untrimmed ftp:// entry");
do_print("Searching for untrimmed ftp:// entry");
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -87,7 +87,7 @@ add_task(function* test_untrimmed_ftp() {
});
add_task(function* test_untrimmed_ftp_path() {
do_log_info("Searching for untrimmed ftp:// entry with path");
do_print("Searching for untrimmed ftp:// entry with path");
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -99,7 +99,7 @@ add_task(function* test_untrimmed_ftp_path() {
});
add_task(function* test_priority_1() {
do_log_info("Ensuring correct priority 1");
do_print("Ensuring correct priority 1");
yield promiseAddVisits([{ uri: NetUtil.newURI("https://www.mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("https://mozilla.org/test/"),
@ -119,7 +119,7 @@ add_task(function* test_priority_1() {
});
add_task(function* test_periority_2() {
do_log_info( "Ensuring correct priority 2");
do_print( "Ensuring correct priority 2");
yield promiseAddVisits([{ uri: NetUtil.newURI("https://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
@ -137,7 +137,7 @@ add_task(function* test_periority_2() {
});
add_task(function* test_periority_3() {
do_log_info("Ensuring correct priority 3");
do_print("Ensuring correct priority 3");
yield promiseAddVisits([{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
@ -153,7 +153,7 @@ add_task(function* test_periority_3() {
});
add_task(function* test_periority_4() {
do_log_info("Ensuring correct priority 4");
do_print("Ensuring correct priority 4");
yield promiseAddVisits([{ uri: NetUtil.newURI("http://www.mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://mozilla.org/test/"),
@ -167,7 +167,7 @@ add_task(function* test_periority_4() {
});
add_task(function* test_priority_5() {
do_log_info("Ensuring correct priority 5");
do_print("Ensuring correct priority 5");
yield promiseAddVisits([{ uri: NetUtil.newURI("ftp://mozilla.org/test/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("ftp://www.mozilla.org/test/"),
@ -181,7 +181,7 @@ add_task(function* test_priority_5() {
});
add_task(function* test_priority_6() {
do_log_info("Ensuring correct priority 6");
do_print("Ensuring correct priority 6");
yield promiseAddVisits([{ uri: NetUtil.newURI("http://www.mozilla.org/test1/"),
transition: TRANSITION_TYPED },
{ uri: NetUtil.newURI("http://www.mozilla.org/test2/"),
@ -195,7 +195,7 @@ add_task(function* test_priority_6() {
});
add_task(function* test_longer_domain() {
do_log_info("Ensuring longer domain can't match");
do_print("Ensuring longer domain can't match");
// The .co should be preferred, but should not get the https from the .com.
// The .co domain must be added later to activate the trigger bug.
yield promiseAddVisits([{ uri: NetUtil.newURI("https://mozilla.com/"),
@ -214,7 +214,7 @@ add_task(function* test_longer_domain() {
});
add_task(function* test_escaped_chars() {
do_log_info("Searching for URL with characters that are normally escaped");
do_print("Searching for URL with characters that are normally escaped");
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.mozilla.org/啊-test"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -226,7 +226,7 @@ add_task(function* test_escaped_chars() {
});
add_task(function* test_unsecure_secure() {
do_log_info("Don't return unsecure URL when searching for secure ones");
do_print("Don't return unsecure URL when searching for secure ones");
yield promiseAddVisits({ uri: NetUtil.newURI("http://test.moz.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -238,7 +238,7 @@ add_task(function* test_unsecure_secure() {
});
add_task(function* test_unsecure_secure_domain() {
do_log_info("Don't return unsecure domain when searching for secure ones");
do_print("Don't return unsecure domain when searching for secure ones");
yield promiseAddVisits({ uri: NetUtil.newURI("http://test.moz.org/test/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -250,7 +250,7 @@ add_task(function* test_unsecure_secure_domain() {
});
add_task(function* test_untyped_www() {
do_log_info("Untyped is not accounted for www");
do_print("Untyped is not accounted for www");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://www.moz.org/test/") });
yield check_autocomplete({
@ -262,7 +262,7 @@ add_task(function* test_untyped_www() {
});
add_task(function* test_untyped_ftp() {
do_log_info("Untyped is not accounted for ftp");
do_print("Untyped is not accounted for ftp");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("ftp://moz.org/test/") });
yield check_autocomplete({
@ -274,7 +274,7 @@ add_task(function* test_untyped_ftp() {
});
add_task(function* test_untyped_secure() {
do_log_info("Untyped is not accounted for https");
do_print("Untyped is not accounted for https");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("https://moz.org/test/") });
yield check_autocomplete({
@ -286,7 +286,7 @@ add_task(function* test_untyped_secure() {
});
add_task(function* test_untyped_secure_www() {
do_log_info("Untyped is not accounted for https://www");
do_print("Untyped is not accounted for https://www");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("https://www.moz.org/test/") });
yield check_autocomplete({

Просмотреть файл

@ -6,7 +6,7 @@
// ensure autocomplete is able to dinamically switch behavior.
add_task(function* test_domain() {
do_log_info("Searching for domain should autoFill it");
do_print("Searching for domain should autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
@ -18,7 +18,7 @@ add_task(function* test_domain() {
});
add_task(function* test_url() {
do_log_info("Searching for url should autoFill it");
do_print("Searching for url should autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
@ -32,7 +32,7 @@ add_task(function* test_url() {
// Now do searches with typed behavior forced to true.
add_task(function* test_untyped_domain() {
do_log_info("Searching for non-typed domain should not autoFill it");
do_print("Searching for non-typed domain should not autoFill it");
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
search: "moz",
@ -43,7 +43,7 @@ add_task(function* test_untyped_domain() {
});
add_task(function* test_typed_domain() {
do_log_info("Searching for typed domain should autoFill it");
do_print("Searching for typed domain should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/typed/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({
@ -55,7 +55,7 @@ add_task(function* test_typed_domain() {
});
add_task(function* test_untyped_url() {
do_log_info("Searching for non-typed url should not autoFill it");
do_print("Searching for non-typed url should not autoFill it");
yield promiseAddVisits(NetUtil.newURI("http://mozilla.org/link/"));
yield check_autocomplete({
search: "mozilla.org/li",
@ -66,7 +66,7 @@ add_task(function* test_untyped_url() {
});
add_task(function* test_typed_url() {
do_log_info("Searching for typed url should autoFill it");
do_print("Searching for typed url should autoFill it");
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
transition: TRANSITION_TYPED });
yield check_autocomplete({

Просмотреть файл

@ -3,21 +3,21 @@
add_task(function*() {
do_log_info("visit url, no protocol");
do_print("visit url, no protocol");
yield check_autocomplete({
search: "mozilla.org",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("visiturl", {url: "http://mozilla.org/", input: "mozilla.org"}), title: "http://mozilla.org/", style: [ "action", "visiturl" ] } ]
});
do_log_info("visit url, with protocol");
do_print("visit url, with protocol");
yield check_autocomplete({
search: "https://mozilla.org",
searchParam: "enable-actions",
matches: [ { uri: makeActionURI("visiturl", {url: "https://mozilla.org/", input: "https://mozilla.org"}), title: "https://mozilla.org/", style: [ "action", "visiturl" ] } ]
});
do_log_info("visit url, about: protocol (no host)");
do_print("visit url, about: protocol (no host)");
yield check_autocomplete({
search: "about:config",
searchParam: "enable-actions",
@ -26,7 +26,7 @@ add_task(function*() {
// This is distinct because of how we predict being able to url autofill via
// host lookups.
do_log_info("visit url, host matching visited host but not visited url");
do_print("visit url, host matching visited host but not visited url");
yield promiseAddVisits([
{ uri: NetUtil.newURI("http://mozilla.org/wine/"), title: "Mozilla Wine", transition: TRANSITION_TYPED },
]);
@ -37,7 +37,7 @@ add_task(function*() {
});
// And hosts with no dot in them are special, due to requiring whitelisting.
do_log_info("visit url, host matching visited host but not visited url, non-whitelisted host");
do_print("visit url, host matching visited host but not visited url, non-whitelisted host");
Services.search.addEngineWithDetails("MozSearch", "", "", "", "GET",
"http://s.example.com/search");
let engine = Services.search.getEngineByName("MozSearch");

Просмотреть файл

@ -47,7 +47,7 @@ add_task(function* test_escape() {
// match only on word boundaries
Services.prefs.setIntPref("browser.urlbar.matchBehavior", 2);
do_log_info("Match 'match' at the beginning or after / or on a CamelCase");
do_print("Match 'match' at the beginning or after / or on a CamelCase");
yield check_autocomplete({
search: "match",
matches: [ { uri: uri1, title: "title1" },
@ -56,7 +56,7 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match 'dont' at the beginning or after /");
do_print("Match 'dont' at the beginning or after /");
yield check_autocomplete({
search: "dont",
matches: [ { uri: uri2, title: "title1" },
@ -64,7 +64,7 @@ add_task(function* test_escape() {
{ uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Match 'match' at the beginning or after / or on a CamelCase");
do_print("Match 'match' at the beginning or after / or on a CamelCase");
yield check_autocomplete({
search: "2",
matches: [ { uri: uri3, title: "matchme2" },
@ -73,7 +73,7 @@ add_task(function* test_escape() {
{ uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
});
do_log_info("Match 't' at the beginning or after /");
do_print("Match 't' at the beginning or after /");
yield check_autocomplete({
search: "t",
matches: [ { uri: uri1, title: "title1" },
@ -85,13 +85,13 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match 'word' after many consecutive word boundaries");
do_print("Match 'word' after many consecutive word boundaries");
yield check_autocomplete({
search: "word",
matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
});
do_log_info("Match a word boundary '/' for everything");
do_print("Match a word boundary '/' for everything");
yield check_autocomplete({
search: "/",
matches: [ { uri: uri1, title: "title1" },
@ -106,50 +106,50 @@ add_task(function* test_escape() {
{ uri: uri10, title: "title1" } ]
});
do_log_info("Match word boundaries '()_+' that are among word boundaries");
do_print("Match word boundaries '()_+' that are among word boundaries");
yield check_autocomplete({
search: "()_+",
matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
});
do_log_info("Katakana characters form a string, so match the beginning");
do_print("Katakana characters form a string, so match the beginning");
yield check_autocomplete({
search: katakana[0],
matches: [ { uri: uri8, title: katakana.join("") } ]
});
/*
do_log_info("Middle of a katakana word shouldn't be matched");
do_print("Middle of a katakana word shouldn't be matched");
yield check_autocomplete({
search: katakana[1],
matches: [ ]
});
*/
do_log_info("Ideographs are treated as words so 'nin' is one word");
do_print("Ideographs are treated as words so 'nin' is one word");
yield check_autocomplete({
search: ideograph[0],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Ideographs are treated as words so 'ten' is another word");
do_print("Ideographs are treated as words so 'ten' is another word");
yield check_autocomplete({
search: ideograph[1],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Ideographs are treated as words so 'do' is yet another word");
do_print("Ideographs are treated as words so 'do' is yet another word");
yield check_autocomplete({
search: ideograph[2],
matches: [ { uri: uri9, title: ideograph.join("") } ]
});
do_log_info("Extra negative assert that we don't match in the middle");
do_print("Extra negative assert that we don't match in the middle");
yield check_autocomplete({
search: "ch",
matches: [ ]
});
do_log_info("Don't match one character after a camel-case word boundary (bug 429498)");
do_print("Don't match one character after a camel-case word boundary (bug 429498)");
yield check_autocomplete({
search: "atch",
matches: [ ]

Просмотреть файл

@ -5,7 +5,7 @@
// Ensure inline autocomplete doesn't return zero frecency pages.
add_task(function* test_zzero_frec_domain() {
do_log_info("Searching for zero frecency domain should not autoFill it");
do_print("Searching for zero frecency domain should not autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
transition: TRANSITION_FRAMED_LINK });
@ -18,7 +18,7 @@ add_task(function* test_zzero_frec_domain() {
});
add_task(function* test_zzero_frec_url() {
do_log_info("Searching for zero frecency url should not autoFill it");
do_print("Searching for zero frecency url should not autoFill it");
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
yield promiseAddVisits({ uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
transition: TRANSITION_FRAMED_LINK });

Просмотреть файл

@ -13,9 +13,9 @@
add_task(function changeuri_unvisited_bookmark()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
"original URI should be zero if original URI is unvisited and " +
"no longer bookmarked.");
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should be zero if original URI is unvisited and " +
"no longer bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -23,14 +23,14 @@ add_task(function changeuri_unvisited_bookmark()
"bookmark title");
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.changeBookmarkURI(id, uri("http://example.com/2"));
yield promiseAsyncUpdates();
do_log_info("Unvisited URI no longer bookmarked => frecency should = 0");
do_print("Unvisited URI no longer bookmarked => frecency should = 0");
do_check_eq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -39,8 +39,8 @@ add_task(function changeuri_unvisited_bookmark()
add_task(function changeuri_visited_bookmark()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is visited.");
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is visited.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -49,7 +49,7 @@ add_task(function changeuri_visited_bookmark()
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
yield promiseAddVisits(TEST_URI);
@ -60,7 +60,7 @@ add_task(function changeuri_visited_bookmark()
yield promiseAsyncUpdates();
do_log_info("*Visited* URI no longer bookmarked => frecency should != 0");
do_print("*Visited* URI no longer bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -69,9 +69,9 @@ add_task(function changeuri_visited_bookmark()
add_task(function changeuri_bookmark_still_bookmarked()
{
do_log_info("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is still " +
"bookmarked.");
do_print("After changing URI of bookmark, frecency of bookmark's " +
"original URI should not be zero if original URI is still " +
"bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id1 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -84,14 +84,14 @@ add_task(function changeuri_bookmark_still_bookmarked()
yield promiseAsyncUpdates();
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.changeBookmarkURI(id1, uri("http://example.com/2"));
yield promiseAsyncUpdates();
do_log_info("URI still bookmarked => frecency should != 0");
do_print("URI still bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -100,7 +100,7 @@ add_task(function changeuri_bookmark_still_bookmarked()
add_task(function changeuri_nonexistent_bookmark()
{
do_log_info("Changing the URI of a nonexistent bookmark should fail.");
do_print("Changing the URI of a nonexistent bookmark should fail.");
function tryChange(itemId)
{
try {

Просмотреть файл

@ -89,7 +89,7 @@ function promiseDefaultSearchEngine() {
function promiseSearchTopic(expectedVerb) {
let deferred = Promise.defer();
Services.obs.addObserver( function observe(subject, topic, verb) {
do_log_info("browser-search-engine-modified: " + verb);
do_print("browser-search-engine-modified: " + verb);
if (verb == expectedVerb) {
Services.obs.removeObserver(observe, "browser-search-engine-modified");
deferred.resolve();

Просмотреть файл

@ -69,7 +69,7 @@ function TitleChangedObserver(aURI,
TitleChangedObserver.prototype = {
__proto__: NavHistoryObserver.prototype,
onTitleChanged(aURI, aTitle, aGUID) {
do_log_info("onTitleChanged(" + aURI.spec + ", " + aTitle + ", " + aGUID + ")");
do_print("onTitleChanged(" + aURI.spec + ", " + aTitle + ", " + aGUID + ")");
if (!this.uri.equals(aURI)) {
return;
}
@ -106,9 +106,9 @@ VisitObserver.prototype = {
aTransitionType,
aGUID)
{
do_log_info("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
", " + aSessionId + ", " + aReferringId + ", " +
aTransitionType + ", " + aGUID + ")");
do_print("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
", " + aSessionId + ", " + aReferringId + ", " +
aTransitionType + ", " + aGUID + ")");
if (!this.uri.equals(aURI) || this.guid != aGUID) {
return;
}
@ -252,7 +252,7 @@ add_task(function* test_no_visits_throws() {
(aPlace.uri ? "uri" : "no uri") + ", " +
(aPlace.guid ? "guid" : "no guid") + ", " +
(aPlace.visits ? "visits array" : "no visits array");
do_log_info(str);
do_print(str);
};
// Loop through every possible case. Note that we don't actually care about
@ -375,7 +375,7 @@ add_task(function* test_non_addable_uri_errors() {
// NetUtil.newURI() can throw if e.g. our app knows about imap://
// but the account is not set up and so the URL is invalid for us.
// Note this in the log but ignore as it's not the subject of this test.
do_log_info("Could not construct URI for '" + url + "'; ignoring");
do_print("Could not construct URI for '" + url + "'; ignoring");
}
});
@ -384,7 +384,7 @@ add_task(function* test_non_addable_uri_errors() {
do_throw("Unexpected success.");
}
for (let place of placesResult.errors) {
do_log_info("Checking '" + place.info.uri.spec + "'");
do_print("Checking '" + place.info.uri.spec + "'");
do_check_eq(place.resultCode, Cr.NS_ERROR_INVALID_ARG);
do_check_false(yield promiseIsURIVisited(place.info.uri));
}
@ -1046,7 +1046,7 @@ add_task(function* test_visit_notifies() {
});
PlacesUtils.history.addObserver(visitObserver, false);
let observer = function(aSubject, aTopic, aData) {
do_log_info("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
do_print("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
do_check_true(aSubject instanceof Ci.nsIURI);
do_check_true(aSubject.equals(place.uri));
@ -1084,7 +1084,7 @@ add_task(function* test_callbacks_not_supplied() {
// NetUtil.newURI() can throw if e.g. our app knows about imap://
// but the account is not set up and so the URL is invalid for us.
// Note this in the log but ignore as it's not the subject of this test.
do_log_info("Could not construct URI for '" + url + "'; ignoring");
do_print("Could not construct URI for '" + url + "'; ignoring");
}
});

Просмотреть файл

@ -48,10 +48,10 @@ function step()
.getService(Ci.mozIAsyncHistory);
for (let scheme in SCHEMES) {
do_log_info("Testing scheme " + scheme);
do_print("Testing scheme " + scheme);
for (let i = 0; i < TRANSITIONS.length; i++) {
let transition = TRANSITIONS[i];
do_log_info("With transition " + transition);
do_print("With transition " + transition);
let uri = NetUtil.newURI(scheme + "mozilla.org/");
@ -63,7 +63,7 @@ function step()
handleError: function () {},
handleResult: function () {},
handleCompletion: function () {
do_log_info("Added visit to " + uri.spec);
do_print("Added visit to " + uri.spec);
history.isURIVisited(uri, function (aURI, aIsVisited) {
do_check_true(uri.equals(aURI));

Просмотреть файл

@ -59,7 +59,7 @@ add_task(function test_execute()
// nsIIOService.newURI() can throw if e.g. our app knows about imap://
// but the account is not set up and so the URL is invalid for us.
// Note this in the log but ignore as it's not the subject of this test.
do_log_info("Could not construct URI for '" + currentURL + "'; ignoring");
do_print("Could not construct URI for '" + currentURL + "'; ignoring");
}
if (cantAddUri) {
try {

Просмотреть файл

@ -16,23 +16,23 @@ function* cleanup() {
}
add_task(function remove_visits_outside_unbookmarked_uri() {
do_log_info("*** TEST: Remove some visits outside valid timeframe from an unbookmarked URI");
do_print("*** TEST: Remove some visits outside valid timeframe from an unbookmarked URI");
do_log_info("Add 10 visits for the URI from way in the past.");
do_print("Add 10 visits for the URI from way in the past.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - 1000 - i });
}
yield promiseAddVisits(visits);
do_log_info("Remove visits using timerange outside the URI's visits.");
do_print("Remove visits using timerange outside the URI's visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that all visits still exist.");
do_print("Run a history query and check that all visits still exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -46,40 +46,40 @@ add_task(function remove_visits_outside_unbookmarked_uri() {
}
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return true.");
do_print("asyncHistory.isURIVisited should return true.");
do_check_true(yield promiseIsURIVisited(TEST_URI));
yield promiseAsyncUpdates();
do_log_info("Frecency should be positive.")
do_print("Frecency should be positive.")
do_check_true(frecencyForUrl(TEST_URI) > 0);
yield cleanup();
});
add_task(function remove_visits_outside_bookmarked_uri() {
do_log_info("*** TEST: Remove some visits outside valid timeframe from a bookmarked URI");
do_print("*** TEST: Remove some visits outside valid timeframe from a bookmarked URI");
do_log_info("Add 10 visits for the URI from way in the past.");
do_print("Add 10 visits for the URI from way in the past.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - 1000 - i });
}
yield promiseAddVisits(visits);
do_log_info("Bookmark the URI.");
do_print("Bookmark the URI.");
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
PlacesUtils.bookmarks.DEFAULT_INDEX,
"bookmark title");
yield promiseAsyncUpdates();
do_log_info("Remove visits using timerange outside the URI's visits.");
do_print("Remove visits using timerange outside the URI's visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that all visits still exist.");
do_print("Run a history query and check that all visits still exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -93,34 +93,34 @@ add_task(function remove_visits_outside_bookmarked_uri() {
}
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return true.");
do_print("asyncHistory.isURIVisited should return true.");
do_check_true(yield promiseIsURIVisited(TEST_URI));
yield promiseAsyncUpdates();
do_log_info("Frecency should be positive.")
do_print("Frecency should be positive.")
do_check_true(frecencyForUrl(TEST_URI) > 0);
yield cleanup();
});
add_task(function remove_visits_unbookmarked_uri() {
do_log_info("*** TEST: Remove some visits from an unbookmarked URI");
do_print("*** TEST: Remove some visits from an unbookmarked URI");
do_log_info("Add 10 visits for the URI from now to 9 usecs in the past.");
do_print("Add 10 visits for the URI from now to 9 usecs in the past.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - i });
}
yield promiseAddVisits(visits);
do_log_info("Remove the 5 most recent visits.");
do_print("Remove the 5 most recent visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 4, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that only the older 5 visits still exist.");
do_print("Run a history query and check that only the older 5 visits still exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -134,40 +134,40 @@ add_task(function remove_visits_unbookmarked_uri() {
}
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return true.");
do_print("asyncHistory.isURIVisited should return true.");
do_check_true(yield promiseIsURIVisited(TEST_URI));
yield promiseAsyncUpdates();
do_log_info("Frecency should be positive.")
do_print("Frecency should be positive.")
do_check_true(frecencyForUrl(TEST_URI) > 0);
yield cleanup();
});
add_task(function remove_visits_bookmarked_uri() {
do_log_info("*** TEST: Remove some visits from a bookmarked URI");
do_print("*** TEST: Remove some visits from a bookmarked URI");
do_log_info("Add 10 visits for the URI from now to 9 usecs in the past.");
do_print("Add 10 visits for the URI from now to 9 usecs in the past.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - i });
}
yield promiseAddVisits(visits);
do_log_info("Bookmark the URI.");
do_print("Bookmark the URI.");
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
PlacesUtils.bookmarks.DEFAULT_INDEX,
"bookmark title");
yield promiseAsyncUpdates();
do_log_info("Remove the 5 most recent visits.");
do_print("Remove the 5 most recent visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 4, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that only the older 5 visits still exist.");
do_print("Run a history query and check that only the older 5 visits still exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -181,34 +181,34 @@ add_task(function remove_visits_bookmarked_uri() {
}
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return true.");
do_print("asyncHistory.isURIVisited should return true.");
do_check_true(yield promiseIsURIVisited(TEST_URI));
yield promiseAsyncUpdates()
do_log_info("Frecency should be positive.")
do_print("Frecency should be positive.")
do_check_true(frecencyForUrl(TEST_URI) > 0);
yield cleanup();
});
add_task(function remove_all_visits_unbookmarked_uri() {
do_log_info("*** TEST: Remove all visits from an unbookmarked URI");
do_print("*** TEST: Remove all visits from an unbookmarked URI");
do_log_info("Add some visits for the URI.");
do_print("Add some visits for the URI.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - i });
}
yield promiseAddVisits(visits);
do_log_info("Remove all visits.");
do_print("Remove all visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should no longer exist in moz_places.");
do_print("URI should no longer exist in moz_places.");
do_check_false(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that no visits exist.");
do_print("Run a history query and check that no visits exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -218,29 +218,29 @@ add_task(function remove_all_visits_unbookmarked_uri() {
do_check_eq(root.childCount, 0);
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return false.");
do_print("asyncHistory.isURIVisited should return false.");
do_check_false(yield promiseIsURIVisited(TEST_URI));
yield cleanup();
});
add_task(function remove_all_visits_unbookmarked_place_uri() {
do_log_info("*** TEST: Remove all visits from an unbookmarked place: URI");
do_log_info("Add some visits for the URI.");
do_print("*** TEST: Remove all visits from an unbookmarked place: URI");
do_print("Add some visits for the URI.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: PLACE_URI, visitDate: NOW - i });
}
yield promiseAddVisits(visits);
do_log_info("Remove all visits.");
do_print("Remove all visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(PLACE_URI.spec));
do_log_info("Run a history query and check that no visits exist.");
do_print("Run a history query and check that no visits exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -250,40 +250,40 @@ add_task(function remove_all_visits_unbookmarked_place_uri() {
do_check_eq(root.childCount, 0);
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return false.");
do_print("asyncHistory.isURIVisited should return false.");
do_check_false(yield promiseIsURIVisited(PLACE_URI));
yield promiseAsyncUpdates();
do_log_info("Frecency should be zero.")
do_print("Frecency should be zero.")
do_check_eq(frecencyForUrl(PLACE_URI.spec), 0);
yield cleanup();
});
add_task(function remove_all_visits_bookmarked_uri() {
do_log_info("*** TEST: Remove all visits from a bookmarked URI");
do_print("*** TEST: Remove all visits from a bookmarked URI");
do_log_info("Add some visits for the URI.");
do_print("Add some visits for the URI.");
let visits = [];
for (let i = 0; i < 10; i++) {
visits.push({ uri: TEST_URI, visitDate: NOW - i });
}
yield promiseAddVisits(visits);
do_log_info("Bookmark the URI.");
do_print("Bookmark the URI.");
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
PlacesUtils.bookmarks.DEFAULT_INDEX,
"bookmark title");
yield promiseAsyncUpdates();
do_log_info("Remove all visits.");
do_print("Remove all visits.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Run a history query and check that no visits exist.");
do_print("Run a history query and check that no visits exist.");
let query = PlacesUtils.history.getNewQuery();
let opts = PlacesUtils.history.getNewQueryOptions();
opts.resultType = opts.RESULTS_AS_VISIT;
@ -293,35 +293,35 @@ add_task(function remove_all_visits_bookmarked_uri() {
do_check_eq(root.childCount, 0);
root.containerOpen = false;
do_log_info("asyncHistory.isURIVisited should return false.");
do_print("asyncHistory.isURIVisited should return false.");
do_check_false(yield promiseIsURIVisited(TEST_URI));
do_log_info("nsINavBookmarksService.isBookmarked should return true.");
do_print("nsINavBookmarksService.isBookmarked should return true.");
do_check_true(PlacesUtils.bookmarks.isBookmarked(TEST_URI));
yield promiseAsyncUpdates();
do_log_info("Frecency should be negative.")
do_print("Frecency should be negative.")
do_check_true(frecencyForUrl(TEST_URI) < 0);
yield cleanup();
});
add_task(function remove_all_visits_bookmarked_uri() {
do_log_info("*** TEST: Remove some visits from a zero frecency URI retains zero frecency");
do_print("*** TEST: Remove some visits from a zero frecency URI retains zero frecency");
do_log_info("Add some visits for the URI.");
do_print("Add some visits for the URI.");
yield promiseAddVisits([{ uri: TEST_URI, transition: TRANSITION_FRAMED_LINK,
visitDate: (NOW - 86400000000) },
{ uri: TEST_URI, transition: TRANSITION_FRAMED_LINK,
visitDate: NOW }]);
do_log_info("Remove newer visit.");
do_print("Remove newer visit.");
PlacesUtils.history.removeVisitsByTimeframe(NOW - 10, NOW);
yield promiseAsyncUpdates();
do_log_info("URI should still exist in moz_places.");
do_print("URI should still exist in moz_places.");
do_check_true(page_in_database(TEST_URI.spec));
do_log_info("Frecency should be zero.")
do_print("Frecency should be zero.")
do_check_eq(frecencyForUrl(TEST_URI), 0);
yield cleanup();

Просмотреть файл

@ -117,7 +117,7 @@ add_task(function test_execute()
yield promiseTopicObserved("places-maintenance-finished");
for (let histogramId in histograms) {
do_log_info("checking histogram " + histogramId);
do_print("checking histogram " + histogramId);
let validate = histograms[histogramId];
let snapshot = Services.telemetry.getHistogramById(histogramId).snapshot();
validate(snapshot.sum);

Просмотреть файл

@ -14,8 +14,8 @@
add_test(function removed_bookmark()
{
do_log_info("After removing bookmark, frecency of bookmark's URI should be " +
"zero if URI is unvisited and no longer bookmarked.");
do_print("After removing bookmark, frecency of bookmark's URI should be " +
"zero if URI is unvisited and no longer bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -23,14 +23,14 @@ add_test(function removed_bookmark()
"bookmark title");
promiseAsyncUpdates().then(function ()
{
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.removeItem(id);
promiseAsyncUpdates().then(function ()
{
do_log_info("Unvisited URI no longer bookmarked => frecency should = 0");
do_print("Unvisited URI no longer bookmarked => frecency should = 0");
do_check_eq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -41,8 +41,8 @@ add_test(function removed_bookmark()
add_test(function removed_but_visited_bookmark()
{
do_log_info("After removing bookmark, frecency of bookmark's URI should " +
"not be zero if URI is visited.");
do_print("After removing bookmark, frecency of bookmark's URI should " +
"not be zero if URI is visited.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -50,7 +50,7 @@ add_test(function removed_but_visited_bookmark()
"bookmark title");
promiseAsyncUpdates().then(function ()
{
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
promiseAddVisits(TEST_URI).then(function () {
@ -58,7 +58,7 @@ add_test(function removed_but_visited_bookmark()
promiseAsyncUpdates().then(function ()
{
do_log_info("*Visited* URI no longer bookmarked => frecency should != 0");
do_print("*Visited* URI no longer bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -70,8 +70,8 @@ add_test(function removed_but_visited_bookmark()
add_test(function remove_bookmark_still_bookmarked()
{
do_log_info("After removing bookmark, frecency of bookmark's URI should ",
"not be zero if URI is still bookmarked.");
do_print("After removing bookmark, frecency of bookmark's URI should " +
"not be zero if URI is still bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id1 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -83,14 +83,14 @@ add_test(function remove_bookmark_still_bookmarked()
"bookmark 2 title");
promiseAsyncUpdates().then(function ()
{
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.removeItem(id1);
promiseAsyncUpdates().then(function ()
{
do_log_info("URI still bookmarked => frecency should != 0");
do_print("URI still bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -101,8 +101,8 @@ add_test(function remove_bookmark_still_bookmarked()
add_test(function cleared_parent_of_visited_bookmark()
{
do_log_info("After removing all children from bookmark's parent, frecency " +
"of bookmark's URI should not be zero if URI is visited.");
do_print("After removing all children from bookmark's parent, frecency " +
"of bookmark's URI should not be zero if URI is visited.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
TEST_URI,
@ -110,7 +110,7 @@ add_test(function cleared_parent_of_visited_bookmark()
"bookmark title");
promiseAsyncUpdates().then(function ()
{
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
promiseAddVisits(TEST_URI).then(function () {
@ -118,7 +118,7 @@ add_test(function cleared_parent_of_visited_bookmark()
promiseAsyncUpdates().then(function ()
{
do_log_info("*Visited* URI no longer bookmarked => frecency should != 0");
do_print("*Visited* URI no longer bookmarked => frecency should != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
remove_all_bookmarks();
@ -130,9 +130,9 @@ add_test(function cleared_parent_of_visited_bookmark()
add_test(function cleared_parent_of_bookmark_still_bookmarked()
{
do_log_info("After removing all children from bookmark's parent, frecency " +
"of bookmark's URI should not be zero if URI is still " +
"bookmarked.");
do_print("After removing all children from bookmark's parent, frecency " +
"of bookmark's URI should not be zero if URI is still " +
"bookmarked.");
const TEST_URI = NetUtil.newURI("http://example.com/1");
let id1 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
TEST_URI,
@ -145,7 +145,7 @@ add_test(function cleared_parent_of_bookmark_still_bookmarked()
"bookmark 2 title");
promiseAsyncUpdates().then(function ()
{
do_log_info("Bookmarked => frecency of URI should be != 0");
do_print("Bookmarked => frecency of URI should be != 0");
do_check_neq(frecencyForUrl(TEST_URI), 0);
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);

Просмотреть файл

@ -42,7 +42,7 @@ add_task(function () {
let backupFile = bookmarksBackupDir.clone();
backupFile.append(backupFilename);
backupFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0666", 8));
do_log_info("Creating fake backup " + backupFile.leafName);
do_print("Creating fake backup " + backupFile.leafName);
if (!backupFile.exists())
do_throw("Unable to create fake backup " + backupFile.leafName);
}