mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-23 04:41:54 +00:00
Bug 1064365 - Deprecated GetKeywordForURI. r=mak
This commit is contained in:
parent
d34e2f8277
commit
567a7beec4
@ -2519,6 +2519,8 @@ nsNavBookmarks::SetKeywordForBookmark(int64_t aBookmarkId,
|
||||
NS_IMETHODIMP
|
||||
nsNavBookmarks::GetKeywordForURI(nsIURI* aURI, nsAString& aKeyword)
|
||||
{
|
||||
PLACES_WARN_DEPRECATED();
|
||||
|
||||
NS_ENSURE_ARG(aURI);
|
||||
aKeyword.Truncate(0);
|
||||
|
||||
|
@ -348,10 +348,6 @@ add_task(function test_bookmarks() {
|
||||
let k = bs.getKeywordForBookmark(kwTestItemId);
|
||||
do_check_eq("bar", k);
|
||||
|
||||
// test getKeywordForURI
|
||||
k = bs.getKeywordForURI(uri("http://keywordtest.com/"));
|
||||
do_check_eq("bar", k);
|
||||
|
||||
// test getURIForKeyword
|
||||
let u = bs.getURIForKeyword("bar");
|
||||
do_check_eq("http://keywordtest.com/", u.spec);
|
||||
|
@ -11,8 +11,16 @@ function check_bookmark_keyword(aItemId, aKeyword)
|
||||
function check_uri_keyword(aURI, aKeyword)
|
||||
{
|
||||
let keyword = aKeyword ? aKeyword.toLowerCase() : null;
|
||||
do_check_eq(PlacesUtils.bookmarks.getKeywordForURI(aURI),
|
||||
keyword);
|
||||
|
||||
for (let bm of PlacesUtils.getBookmarksForURI(aURI)) {
|
||||
let kid = PlacesUtils.bookmarks.getKeywordForBookmark(bm);
|
||||
if (kid && !keyword) {
|
||||
Assert.ok(false, `${aURI.spec} should not have a keyword`);
|
||||
} else if (keyword && kid == keyword) {
|
||||
Assert.equal(kid, keyword, "Found the keyword");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (aKeyword) {
|
||||
// This API can't tell which uri the user wants, so it returns a random one.
|
||||
|
@ -88,8 +88,6 @@ add_task(function () {
|
||||
|
||||
ok(PlacesUtils.bookmarks.isBookmarked(bookmarkUri),
|
||||
"Bookmark should be bookmarked, data should be retrievable");
|
||||
is(bookmarkKeyword, PlacesUtils.bookmarks.getKeywordForURI(bookmarkUri),
|
||||
"Check bookmark uri keyword");
|
||||
is(getPlacesItemsCount(), count,
|
||||
"Check the new bookmark items count");
|
||||
is(isBookmarkAltered(), false, "Check if bookmark has been visited");
|
||||
|
Loading…
x
Reference in New Issue
Block a user