зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1444912 - Add automated test to check that bookmarks can be opened from the Library r=standard8
This commit is contained in:
Родитель
3e583258c2
Коммит
7eb67f46be
|
@ -89,6 +89,8 @@ skip-if = (os == 'win' && ccov) # Bug 1423667
|
|||
[browser_library_open_leak.js]
|
||||
[browser_library_openFlatContainer.js]
|
||||
skip-if = (os == 'win' && ccov) # Bug 1423667
|
||||
[browser_library_open_bookmark.js]
|
||||
skip-if = (os == 'win' && ccov) # Bug 1423667
|
||||
[browser_library_panel_leak.js]
|
||||
skip-if = (os == 'win' && ccov) # Bug 1423667
|
||||
[browser_library_search.js]
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test that the a bookmark can be opened from the Library by mouse double click.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const TEST_URL = "about:buildconfig";
|
||||
|
||||
add_task(async function test_open_bookmark_from_library() {
|
||||
let bm = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
url: TEST_URL,
|
||||
title: TEST_URL,
|
||||
});
|
||||
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:blank");
|
||||
|
||||
let gLibrary = await promiseLibrary("UnfiledBookmarks");
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
await promiseLibraryClosed(gLibrary);
|
||||
await PlacesUtils.bookmarks.eraseEverything();
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
let bmLibrary = gLibrary.ContentTree.view.view.nodeForTreeIndex(0);
|
||||
Assert.equal(bmLibrary.title, bm.title, "Found bookmark in the right pane");
|
||||
|
||||
gLibrary.ContentTree.view.selectNode(bmLibrary);
|
||||
synthesizeClickOnSelectedTreeCell(gLibrary.ContentTree.view,
|
||||
{ clickCount: 2 });
|
||||
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, TEST_URL);
|
||||
Assert.ok(true, "Expected tab was loaded");
|
||||
});
|
Загрузка…
Ссылка в новой задаче