From fb52f9b861b658e7c122e70750b9f8a5b89ea8c5 Mon Sep 17 00:00:00 2001 From: Lucius C <58442255+czlucius@users.noreply.github.com> Date: Thu, 3 Feb 2022 12:58:41 +0800 Subject: [PATCH] For #13336: Open bookmarks in current tab (#23169) * For #13336: Open bookmarks in current tab * For #13336: Fix tests to verify bookmark opening in current tab * Change test name for handleBookmarkTapped --- .../mozilla/fenix/library/bookmarks/BookmarkController.kt | 2 +- .../fenix/library/bookmarks/BookmarkControllerTest.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkController.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkController.kt index 629db7611a9e..385849a24a62 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkController.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkController.kt @@ -77,7 +77,7 @@ class DefaultBookmarkController( val flags = EngineSession.LoadUrlFlags.select(EngineSession.LoadUrlFlags.ALLOW_JAVASCRIPT_URL) openInNewTabAndShow( item.url!!, - true, + false, BrowserDirection.FromBookmarks, activity.browsingModeManager.mode, flags diff --git a/app/src/test/java/org/mozilla/fenix/library/bookmarks/BookmarkControllerTest.kt b/app/src/test/java/org/mozilla/fenix/library/bookmarks/BookmarkControllerTest.kt index b72a931823f6..226ac4e7408c 100644 --- a/app/src/test/java/org/mozilla/fenix/library/bookmarks/BookmarkControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/library/bookmarks/BookmarkControllerTest.kt @@ -110,7 +110,7 @@ class BookmarkControllerTest { } @Test - fun `handleBookmarkTapped should load the bookmark in a new tab`() { + fun `handleBookmarkTapped should load the bookmark in the current tab`() { var invokePendingDeletionInvoked = false val flags = EngineSession.LoadUrlFlags.select(EngineSession.LoadUrlFlags.ALLOW_JAVASCRIPT_URL) @@ -124,7 +124,7 @@ class BookmarkControllerTest { verify { homeActivity.openToBrowserAndLoad( item.url!!, - true, + false, BrowserDirection.FromBookmarks, flags = flags ) @@ -290,7 +290,7 @@ class BookmarkControllerTest { verify { homeActivity.openToBrowserAndLoad( item.url!!, - true, + false, BrowserDirection.FromBookmarks, flags = flags )