diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /browser/components/places/tests | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/places/tests')
24 files changed, 161 insertions, 101 deletions
diff --git a/browser/components/places/tests/browser/browser.toml b/browser/components/places/tests/browser/browser.toml index 1b0e2571d4..8a971684f8 100644 --- a/browser/components/places/tests/browser/browser.toml +++ b/browser/components/places/tests/browser/browser.toml @@ -48,13 +48,6 @@ skip-if = ["os != 'mac'"] # Mac-only functionality ["browser_bookmark_add_tags.js"] https_first_disabled = true -["browser_bookmark_all_tabs.js"] -https_first_disabled = true -support-files = [ - "bookmark_dummy_1.html", - "bookmark_dummy_2.html", -] - ["browser_bookmark_backup_export_import.js"] ["browser_bookmark_change_location.js"] @@ -63,6 +56,8 @@ support-files = [ ["browser_bookmark_copy_folder_tree.js"] +["browser_bookmark_current_tabs.js"] + ["browser_bookmark_folder_moveability.js"] ["browser_bookmark_menu_ctrl_click.js"] diff --git a/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js b/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js index c841eb276b..0dccc88d23 100644 --- a/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js +++ b/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js @@ -77,7 +77,7 @@ async function checkResponse({ showToolbar, expectedFolder, reason }) { add_task(async function test_new_on_toolbar() { await BrowserTestUtils.withNewTab( { gBrowser: win.gBrowser, url: "https://example.com/1" }, - async browser => { + async () => { let toolbar = win.document.getElementById("PersonalToolbar"); Assert.equal( toolbar.collapsed, @@ -111,7 +111,7 @@ add_task(async function test_new_on_toolbar_never_show_toolbar() { await BrowserTestUtils.withNewTab( { gBrowser: win.gBrowser, url: "https://example.com/1" }, - async browser => { + async () => { let toolbar = win.document.getElementById("PersonalToolbar"); Assert.equal( toolbar.collapsed, @@ -144,7 +144,7 @@ add_task(async function test_existing_on_toolbar() { }); await BrowserTestUtils.withNewTab( { gBrowser: win.gBrowser, url: "https://example.com/editing-test" }, - async browser => { + async () => { await TestUtils.waitForCondition( () => win.BookmarkingUI.status == BookmarkingUI.STATUS_STARRED, "Page should be starred." diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js b/browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js index 67d1406bc1..09dc0c7e45 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_no_user_actions.js @@ -50,10 +50,10 @@ add_task(async function test_change_title_from_BookmarkStar() { mozCursor: "auto", mozItemCount: 1, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return this.types; }, - mozGetDataAt(i) { + mozGetDataAt() { return bookmarkWithId; }, }; diff --git a/browser/components/places/tests/browser/browser_bookmark_all_tabs.js b/browser/components/places/tests/browser/browser_bookmark_all_tabs.js deleted file mode 100644 index 2852bf4019..0000000000 --- a/browser/components/places/tests/browser/browser_bookmark_all_tabs.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Test for Bug 446171 - Name field of bookmarks saved via 'Bookmark All Tabs' - * has '(null)' value if history is disabled or just in private browsing mode - */ -"use strict"; - -add_task(async function () { - const BASE_URL = - "http://example.org/browser/browser/components/places/tests/browser/"; - const TEST_PAGES = [ - BASE_URL + "bookmark_dummy_1.html", - BASE_URL + "bookmark_dummy_2.html", - BASE_URL + "bookmark_dummy_1.html", - ]; - - function promiseAddTab(url) { - return BrowserTestUtils.openNewForegroundTab(gBrowser, url); - } - - let tabs = await Promise.all(TEST_PAGES.map(promiseAddTab)); - - let URIs = PlacesCommandHook.uniqueCurrentPages; - is(URIs.length, 3, "Only unique pages are returned"); - - Assert.deepEqual( - URIs.map(URI => URI.uri.spec), - [ - "about:blank", - BASE_URL + "bookmark_dummy_1.html", - BASE_URL + "bookmark_dummy_2.html", - ], - "Correct URIs are returned" - ); - - Assert.deepEqual( - URIs.map(URI => URI.title), - ["New Tab", "Bookmark Dummy 1", "Bookmark Dummy 2"], - "Correct titles are returned" - ); - - registerCleanupFunction(async function () { - for (let tab of tabs) { - BrowserTestUtils.removeTab(tab); - } - }); -}); diff --git a/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js b/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js index 8b954a8469..356e9e8d78 100644 --- a/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js +++ b/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js @@ -94,7 +94,7 @@ async function validateImportedBookmarks(fromPlaces) { } } -async function promiseImportExport(aWindow) { +async function promiseImportExport() { saveDir = Services.dirsvc.get("TmpD", Ci.nsIFile); saveDir.append("temp-bookmarks-export"); if (!saveDir.exists()) { diff --git a/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js b/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js index ac9120d3d6..16aeb08ad8 100644 --- a/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js +++ b/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js @@ -377,7 +377,7 @@ add_task(async function test_sidebar_folder_contextmenu_contents() { await withSidebarTree("bookmarks", async tree => { await checkContextMenu( - async bookmark => { + async () => { let folder = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "folder", @@ -416,7 +416,7 @@ add_task(async function test_sidebar_multiple_folders_contextmenu_contents() { await withSidebarTree("bookmarks", async tree => { await checkContextMenu( - async bookmark => { + async () => { let folder1 = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid, title: "folder 1", @@ -556,7 +556,7 @@ add_task(async function test_library_bookmark_contextmenu_contents() { ); } - await withLibraryWindow("BookmarksToolbar", async ({ left, right }) => { + await withLibraryWindow("BookmarksToolbar", async ({ right }) => { await checkContextMenu( async bookmark => { let contextMenu = right.ownerDocument.getElementById("placesContext"); @@ -594,7 +594,7 @@ add_task(async function test_library_bookmark_search_contextmenu_contents() { ); } - await withLibraryWindow("BookmarksToolbar", async ({ left, right }) => { + await withLibraryWindow("BookmarksToolbar", async ({ right }) => { await checkContextMenu( async bookmark => { info("Checking bookmark library menu contents in search context"); @@ -704,7 +704,7 @@ add_task(async function test_sidebar_multiple_links_contextmenu_contents() { await withSidebarTree("history", async tree => { await checkContextMenu( - async bookmark => { + async () => { await PlacesTestUtils.addVisits([ "http://example-1.com/", "http://example-2.com/", @@ -774,9 +774,9 @@ add_task(async function test_library_noselection_contextmenu_contents() { "placesContext_paste", ]; - await withLibraryWindow("BookmarksToolbar", async ({ left, right }) => { + await withLibraryWindow("BookmarksToolbar", async ({ right }) => { await checkContextMenu( - async bookmark => { + async () => { let contextMenu = right.ownerDocument.getElementById("placesContext"); let popupShownPromise = BrowserTestUtils.waitForEvent( contextMenu, diff --git a/browser/components/places/tests/browser/browser_bookmark_current_tabs.js b/browser/components/places/tests/browser/browser_bookmark_current_tabs.js new file mode 100644 index 0000000000..a6dd77d4c5 --- /dev/null +++ b/browser/components/places/tests/browser/browser_bookmark_current_tabs.js @@ -0,0 +1,71 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { MockRegistrar } = ChromeUtils.importESModule( + "resource://testing-common/MockRegistrar.sys.mjs" +); + +add_setup(() => { + let mockPromptService = { + confirmExBC() { + return 0; + }, + QueryInterface: ChromeUtils.generateQI(["nsIPromptService"]), + }; + let mockPromptServiceCID = MockRegistrar.register( + "@mozilla.org/prompter;1", + mockPromptService + ); + registerCleanupFunction(() => { + MockRegistrar.unregister(mockPromptServiceCID); + }); +}); + +add_task(async function bookmarkPage() { + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "https://user:pass@example.com/" + ); + + let promiseBookmark = PlacesTestUtils.waitForNotification( + "bookmark-added", + () => true + ); + PlacesCommandHook.bookmarkPage(); + await promiseBookmark; + + let bookmark = await PlacesUtils.bookmarks.fetch({ + url: "https://example.com/", + }); + Assert.ok(bookmark, "Found the expected bookmark"); + + BrowserTestUtils.removeTab(tab); + await PlacesUtils.bookmarks.eraseEverything(); +}); + +add_task(async function bookmarkTabs() { + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + "https://user:pass@example.com/" + ); + + await withBookmarksDialog( + false, + PlacesCommandHook.bookmarkTabs, + async dialog => { + dialog.document + .getElementById("bookmarkpropertiesdialog") + .getButton("accept") + .click(); + } + ); + + let bookmark = await PlacesUtils.bookmarks.fetch({ + url: "https://example.com/", + }); + Assert.ok(bookmark, "Found the expected bookmark"); + + BrowserTestUtils.removeTab(tab); + await PlacesUtils.bookmarks.eraseEverything(); +}); diff --git a/browser/components/places/tests/browser/browser_bookmark_popup.js b/browser/components/places/tests/browser/browser_bookmark_popup.js index 616755b7e1..3f9e85b683 100644 --- a/browser/components/places/tests/browser/browser_bookmark_popup.js +++ b/browser/components/places/tests/browser/browser_bookmark_popup.js @@ -345,7 +345,7 @@ add_task(async function bookmark_with_invalid_default_folder() { await test_bookmarks_popup({ isNewBookmark: true, shouldAutoClose: true, - async popupShowFn(browser) { + async popupShowFn() { EventUtils.synthesizeKey("d", { accelKey: true }, win); }, }); @@ -510,7 +510,7 @@ add_task(async function contextmenu_new_bookmark_keypress_no_autoclose() { add_task(async function bookmarks_menu_new_bookmark_remove_bookmark() { await test_bookmarks_popup({ isNewBookmark: true, - popupShowFn(browser) { + popupShowFn() { win.document.getElementById("menu_bookmarkThisPage").doCommand(); }, shouldAutoClose: true, @@ -524,7 +524,7 @@ add_task(async function bookmarks_menu_new_bookmark_remove_bookmark() { add_task(async function ctrl_d_edit_bookmark_remove_bookmark() { await test_bookmarks_popup({ isNewBookmark: false, - popupShowFn(browser) { + popupShowFn() { EventUtils.synthesizeKey("D", { accelKey: true }, win); }, shouldAutoClose: true, @@ -544,7 +544,7 @@ add_task(async function enter_on_remove_bookmark_should_remove_bookmark() { await test_bookmarks_popup({ isNewBookmark: true, - popupShowFn(browser) { + popupShowFn() { EventUtils.synthesizeKey("D", { accelKey: true }, win); }, shouldAutoClose: true, @@ -589,7 +589,7 @@ add_task(async function mouse_hovering_panel_should_prevent_autoclose() { add_task(async function ctrl_d_new_bookmark_mousedown_mouseout_no_autoclose() { await test_bookmarks_popup({ isNewBookmark: true, - popupShowFn(browser) { + popupShowFn() { EventUtils.synthesizeKey("D", { accelKey: true }, win); }, async popupEditFn() { @@ -635,7 +635,7 @@ add_task(async function ctrl_d_new_bookmark_mousedown_mouseout_no_autoclose() { add_task(async function enter_during_autocomplete_should_prevent_autoclose() { await test_bookmarks_popup({ isNewBookmark: false, - async popupShowFn(browser) { + async popupShowFn() { PlacesUtils.tagging.tagURI(makeURI(TEST_URL), ["Abc"]); EventUtils.synthesizeKey("d", { accelKey: true }, win); }, @@ -673,7 +673,7 @@ add_task(async function enter_during_autocomplete_should_prevent_autoclose() { add_task(async function escape_during_autocomplete_should_prevent_autoclose() { await test_bookmarks_popup({ isNewBookmark: false, - async popupShowFn(browser) { + async popupShowFn() { PlacesUtils.tagging.tagURI(makeURI(TEST_URL), ["Abc"]); EventUtils.synthesizeKey("d", { accelKey: true }, win); }, diff --git a/browser/components/places/tests/browser/browser_bookmarksProperties.js b/browser/components/places/tests/browser/browser_bookmarksProperties.js index 8f1d783a49..cfa9e6c581 100644 --- a/browser/components/places/tests/browser/browser_bookmarksProperties.js +++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js @@ -88,7 +88,7 @@ gTests.push({ let unloadPromise = new Promise(resolve => { this.window.addEventListener( "unload", - function (event) { + function () { tagsField.popup.removeEventListener( "popuphidden", popupListener, @@ -216,7 +216,7 @@ gTests.push({ let hiddenPromise = new Promise(resolve => { this.window.addEventListener( "unload", - function (event) { + function () { tagsField.popup.removeEventListener( "popuphidden", popupListener, @@ -340,7 +340,7 @@ gTests.push({ let unloadPromise = new Promise(resolve => { this.window.addEventListener( "unload", - event => { + () => { Assert.ok( self._cleanShutdown, "Dialog window should not be closed by pressing ESC in folder name textbox" diff --git a/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js b/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js index 5ecf95d94e..b1fb763fb7 100644 --- a/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js +++ b/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js @@ -19,7 +19,7 @@ function waitForBookmarkElements(expectedCount) { } return new Promise(resolve => { info("Waiting for bookmarks"); - let mut = new MutationObserver(mutations => { + let mut = new MutationObserver(() => { info("Elements appeared"); if (container.childElementCount == expectedCount) { resolve(); @@ -160,7 +160,7 @@ add_task(async function clickWithPrefSet() { // With loadBookmarksInTabs, reuse current tab if blank for (let button of [0, 1]) { - await BrowserTestUtils.withNewTab({ gBrowser }, async tab => { + await BrowserTestUtils.withNewTab({ gBrowser }, async () => { promise = waitForLoad(gBrowser.selectedBrowser, TEST_PAGES[1]); EventUtils.synthesizeMouseAtCenter(gBookmarkElements[1], { button, diff --git a/browser/components/places/tests/browser/browser_controller_onDrop.js b/browser/components/places/tests/browser/browser_controller_onDrop.js index cbda2612cf..c2edf4164f 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop.js @@ -53,10 +53,10 @@ async function run_drag_test(startBookmarkIndex, insertionIndex) { mozCursor: "auto", mozItemCount: 1, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return [this._data[0].type]; }, - mozGetDataAt(i) { + mozGetDataAt() { return this._data[0].data; }, mozSetDataAt(type, data, index) { diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_query.js b/browser/components/places/tests/browser/browser_controller_onDrop_query.js index 10dd6faa3c..f5004d40d0 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_query.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_query.js @@ -37,10 +37,10 @@ async function simulateDrop( mozCursor: "auto", mozItemCount: 1, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return [this._data[0].type]; }, - mozGetDataAt(i) { + mozGetDataAt() { return this._data[0].data; }, mozSetDataAt(type, data, index) { diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js index 2637d4d724..2281e0777e 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js @@ -48,10 +48,10 @@ async function simulateDrop( mozCursor: "auto", mozItemCount: 1, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return [this._data[0].type]; }, - mozGetDataAt(i) { + mozGetDataAt() { return this._data[0].data; }, mozSetDataAt(type, data, index) { @@ -247,10 +247,10 @@ add_task(async function test_move_within_itself() { mozCursor: "auto", mozItemCount: bookmarks.length, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return [this._data[0].type]; }, - mozGetDataAt(i) { + mozGetDataAt() { return this._data[0].data; }, mozSetDataAt(type, data, index) { diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js index 64c448ec3f..297219d06c 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js @@ -81,10 +81,10 @@ async function run_drag_test(startBookmarkIndex, newParentGuid) { mozCursor: "auto", mozItemCount: 1, types: [PlacesUtils.TYPE_X_MOZ_PLACE], - mozTypesAt(i) { + mozTypesAt() { return this.types; }, - mozGetDataAt(i) { + mozGetDataAt() { return bookmarkWithId; }, }; diff --git a/browser/components/places/tests/browser/browser_library_delete.js b/browser/components/places/tests/browser/browser_library_delete.js index fe95be0604..c11a4bc8b2 100644 --- a/browser/components/places/tests/browser/browser_library_delete.js +++ b/browser/components/places/tests/browser/browser_library_delete.js @@ -120,7 +120,6 @@ add_task(async function test_ensure_correct_selection_and_functionality() { }); add_task(async function test_repeated_remove_bookmark() { - // Select and open the left pane "History" query. let PO = gLibrary.PlacesOrganizer; PO.selectLeftPaneBuiltIn("UnfiledBookmarks"); @@ -154,4 +153,45 @@ add_task(async function test_repeated_remove_bookmark() { PO._places.controller.doCommand("cmd_delete"); Assert.equal(spy.callCount, 4, "Should have been invoked again"); Assert.equal(stub.callCount, 2, "Should have been invoked again"); + + sinon.restore(); +}); + +add_task(async function test_repeated_remove_separator() { + await PlacesUtils.bookmarks.eraseEverything(); + + const NUM_SEPARATORS = 2; + for (let i = 0; i < NUM_SEPARATORS; ++i) { + await PlacesUtils.bookmarks.insert({ + parentGuid: PlacesUtils.bookmarks.unfiledGuid, + type: PlacesUtils.bookmarks.TYPE_SEPARATOR, + index: 0, + }); + } + + gLibrary.PlacesOrganizer.selectLeftPaneBuiltIn("UnfiledBookmarks"); + let view = gLibrary.ContentTree.view; + view.focus(); + let unsortedNode = PlacesUtils.asContainer(view.result.root); + Assert.equal(2, unsortedNode.childCount, "Unsorted node has 2 children"); + + for (let i = NUM_SEPARATORS - 1; i >= 0; --i) { + let node = unsortedNode.getChild(i); + Assert.equal( + node.type, + Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR, + "Separator found in unsorted bookmarks" + ); + view.selectNode(node); + Assert.ok( + view.controller.isCommandEnabled("cmd_delete"), + "Delete command is enabled" + ); + view.controller.doCommand("cmd_delete"); + await PlacesTestUtils.waitForNotification("bookmark-removed", events => + events.some(({ guid }) => guid == node.bookmarkGuid) + ); + } + + Assert.equal(unsortedNode.childCount, 0, "Unsorted node has no children"); }); diff --git a/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js b/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js index ed124a047a..f1228ba775 100644 --- a/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js +++ b/browser/components/places/tests/browser/browser_library_delete_bookmarks_in_tags.js @@ -20,7 +20,7 @@ add_task(async function test_tags() { Services.io.newURI("http://example.com/3"), ]; - let children = uris.map((uri, index, arr) => { + let children = uris.map((uri, index) => { return { title: `bm${index}`, url: uri, diff --git a/browser/components/places/tests/browser/browser_panelview_bookmarks_delete.js b/browser/components/places/tests/browser/browser_panelview_bookmarks_delete.js index 3a5527a689..c00c5973fd 100644 --- a/browser/components/places/tests/browser/browser_panelview_bookmarks_delete.js +++ b/browser/components/places/tests/browser/browser_panelview_bookmarks_delete.js @@ -39,7 +39,7 @@ add_task(async function test_panelview_bookmarks_delete() { await promise; promise = new Promise(resolve => { - let observer = new MutationObserver(mutations => { + let observer = new MutationObserver(() => { if (listItem.parentNode == null) { Assert.ok(true, "The bookmarks list item was removed."); observer.disconnect(); diff --git a/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js b/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js index 92f98b898c..10f7d45d39 100644 --- a/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js +++ b/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js @@ -79,7 +79,7 @@ add_task(async function test_open_bookmark_in_tab_from_sidebar() { set: [[PREF_LOAD_BOOKMARKS_IN_TABS, true]], }); - await BrowserTestUtils.withNewTab({ gBrowser }, async initialTab => { + await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await withSidebarTree("bookmarks", async tree => { tree.selectItems([gBms[0].guid]); let loadedPromise = BrowserTestUtils.browserLoaded( diff --git a/browser/components/places/tests/browser/browser_sidebarpanels_click.js b/browser/components/places/tests/browser/browser_sidebarpanels_click.js index 4b231c92b0..3e5b1c6ec6 100644 --- a/browser/components/places/tests/browser/browser_sidebarpanels_click.js +++ b/browser/components/places/tests/browser/browser_sidebarpanels_click.js @@ -54,7 +54,7 @@ add_task(async function test_sidebarpanels_click() { async selectNode(tree) { tree.selectItems([this._bookmark.guid]); }, - cleanup(aCallback) { + cleanup() { return PlacesUtils.bookmarks.remove(this._bookmark); }, sidebarName: BOOKMARKS_SIDEBAR_ID, @@ -84,7 +84,7 @@ add_task(async function test_sidebarpanels_click() { ); is(tree.selectedNode.itemId, -1, "The selected node is not bookmarked"); }, - cleanup(aCallback) { + cleanup() { return PlacesUtils.history.clear(); }, sidebarName: HISTORY_SIDEBAR_ID, diff --git a/browser/components/places/tests/browser/browser_toolbar_overflow.js b/browser/components/places/tests/browser/browser_toolbar_overflow.js index 3f16c2a126..216ad56700 100644 --- a/browser/components/places/tests/browser/browser_toolbar_overflow.js +++ b/browser/components/places/tests/browser/browser_toolbar_overflow.js @@ -419,7 +419,7 @@ async function toggleToolbar(show, expectedMinChildCount = 0) { if (getPlacesChildren().length < expectedMinChildCount) { await new Promise(resolve => { info("Waiting for bookmark elements to appear"); - let mut = new MutationObserver(mutations => { + let mut = new MutationObserver(() => { let children = getPlacesChildren(); info(`${children.length} bookmark elements appeared`); if (children.length >= expectedMinChildCount) { diff --git a/browser/components/places/tests/browser/head.js b/browser/components/places/tests/browser/head.js index 21790d54aa..bcd89bce15 100644 --- a/browser/components/places/tests/browser/head.js +++ b/browser/components/places/tests/browser/head.js @@ -456,7 +456,7 @@ function promisePopupShown(popup) { if (popup.state == "open") { resolve(); } else { - let onPopupShown = event => { + let onPopupShown = () => { popup.removeEventListener("popupshown", onPopupShown); resolve(); }; @@ -468,7 +468,7 @@ function promisePopupShown(popup) { // Function copied from browser/base/content/test/general/head.js. function promisePopupHidden(popup) { return new Promise(resolve => { - let onPopupHidden = event => { + let onPopupHidden = () => { popup.removeEventListener("popuphidden", onPopupHidden); resolve(); }; diff --git a/browser/components/places/tests/browser/interactions/browser_interactions_typing.js b/browser/components/places/tests/browser/interactions/browser_interactions_typing.js index 99269c3265..cccc3a5ce9 100644 --- a/browser/components/places/tests/browser/interactions/browser_interactions_typing.js +++ b/browser/components/places/tests/browser/interactions/browser_interactions_typing.js @@ -118,7 +118,7 @@ add_task(async function test_load_type_and_navigate_away() { add_task(async function test_no_typing_close_tab() { await Interactions.reset(); - await BrowserTestUtils.withNewTab(TEST_URL, async browser => {}); + await BrowserTestUtils.withNewTab(TEST_URL, async () => {}); await assertDatabaseValues([ { diff --git a/browser/components/places/tests/browser/interactions/browser_interactions_view_time.js b/browser/components/places/tests/browser/interactions/browser_interactions_view_time.js index 278ae10228..bf74bdb2f8 100644 --- a/browser/components/places/tests/browser/interactions/browser_interactions_view_time.js +++ b/browser/components/places/tests/browser/interactions/browser_interactions_view_time.js @@ -62,7 +62,7 @@ add_task(async function test_interactions_simple_load_and_change_to_non_http() { add_task(async function test_interactions_close_tab() { await Interactions.reset(); - await BrowserTestUtils.withNewTab(TEST_URL, async browser => { + await BrowserTestUtils.withNewTab(TEST_URL, async () => { Interactions._pageViewStartTime = Cu.now() - 20000; }); @@ -373,7 +373,7 @@ add_task(async function test_interactions_idle() { await Interactions.reset(); let lastViewTime; - await BrowserTestUtils.withNewTab(TEST_URL, async browser => { + await BrowserTestUtils.withNewTab(TEST_URL, async () => { Interactions._pageViewStartTime = Cu.now() - 10000; Interactions.observe(null, "idle", ""); diff --git a/browser/components/places/tests/unit/test_clearHistory_shutdown.js b/browser/components/places/tests/unit/test_clearHistory_shutdown.js index 27b432e569..e86b511a25 100644 --- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js +++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js @@ -124,7 +124,7 @@ function storeCache(aURL, aContent) { return new Promise(resolve => { let storeCacheListener = { - onCacheEntryCheck(entry) { + onCacheEntryCheck() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; }, |