mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1423118 - Add a test for checking that tags can be added to bookmarks using the library window. r=Standard8
--HG-- extra : amend_source : d19fc15afddc933dcf51af75446a56b83807dd4c
This commit is contained in:
parent
a121d5218c
commit
62d7a2f07f
@ -52,6 +52,7 @@ subsuite = clipboard
|
||||
[browser_drag_bookmarks_on_toolbar.js]
|
||||
[browser_forgetthissite_single.js]
|
||||
[browser_history_sidebar_search.js]
|
||||
[browser_library_add_tags.js]
|
||||
[browser_library_batch_delete.js]
|
||||
skip-if = (os == 'win' && ccov) # Bug 1423667
|
||||
[browser_library_commands.js]
|
||||
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Tests that multiple tags can be added to a bookmark using the Library.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
add_task(async function test_add_tags() {
|
||||
const uri = "http://example.com/";
|
||||
|
||||
// Add a bookmark.
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
url: uri,
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid
|
||||
});
|
||||
|
||||
// Open the Library and select the "UnfilledBookmarks".
|
||||
let library = await promiseLibrary("UnfiledBookmarks");
|
||||
|
||||
let bookmarkNode = library.ContentTree.view.selectedNode;
|
||||
Assert.equal(bookmarkNode.uri, "http://example.com/", "Found the expected bookmark");
|
||||
|
||||
// Add a tag to the bookmark.
|
||||
fillBookmarkTextField("editBMPanel_tagsField", "tag1", library);
|
||||
|
||||
await waitForCondition(() => bookmarkNode.tags === "tag1", "Node tag is correct");
|
||||
|
||||
// Add a new tag to the bookmark.
|
||||
fillBookmarkTextField("editBMPanel_tagsField", "tag1, tag2", library);
|
||||
|
||||
await waitForCondition(() => bookmarkNode.tags === "tag1, tag2", "Node tag is correct");
|
||||
|
||||
// Check the tag change has been.
|
||||
let tags = PlacesUtils.tagging.getTagsForURI(Services.io.newURI(uri));
|
||||
Assert.equal(tags.length, 2, "Found the right number of tags");
|
||||
Assert.deepEqual(tags, ["tag1", "tag2"], "Found the expected tags");
|
||||
|
||||
// Cleanup
|
||||
registerCleanupFunction(async function() {
|
||||
await promiseLibraryClosed(library);
|
||||
await PlacesUtils.bookmarks.eraseEverything();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user