[TabBottomSheet] Restructure files [chromium/src : main]

0 views
Skip to first unread message

Hitarth Kothari (Gerrit)

unread,
Jan 15, 2026, 2:48:32 PM (2 days ago) Jan 15
to Calder Kitagawa, chromium...@chromium.org, davidj...@chromium.org, gogeral...@chromium.org, hanxi...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org
Attention needed from Calder Kitagawa

Hitarth Kothari voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Calder Kitagawa
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic9eec323a4fa92cf69908d42734e6fe91746bece
Gerrit-Change-Number: 7487730
Gerrit-PatchSet: 1
Gerrit-Owner: Hitarth Kothari <hitarth...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Hitarth Kothari <hitarth...@google.com>
Gerrit-Attention: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Comment-Date: Thu, 15 Jan 2026 19:48:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Calder Kitagawa (Gerrit)

unread,
Jan 15, 2026, 2:51:15 PM (2 days ago) Jan 15
to Hitarth Kothari, Chromium LUCI CQ, chromium...@chromium.org, davidj...@chromium.org, gogeral...@chromium.org, hanxi...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org
Attention needed from Hitarth Kothari

Calder Kitagawa voted and added 1 comment

Votes added by Calder Kitagawa

Code-Review+1
Commit-Queue+2

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Calder Kitagawa . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Hitarth Kothari
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic9eec323a4fa92cf69908d42734e6fe91746bece
Gerrit-Change-Number: 7487730
Gerrit-PatchSet: 1
Gerrit-Owner: Hitarth Kothari <hitarth...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Hitarth Kothari <hitarth...@google.com>
Gerrit-Attention: Hitarth Kothari <hitarth...@google.com>
Gerrit-Comment-Date: Thu, 15 Jan 2026 19:51:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Hitarth Kothari (Gerrit)

unread,
Jan 15, 2026, 3:08:06 PM (2 days ago) Jan 15
to Calder Kitagawa, Chromium LUCI CQ, chromium...@chromium.org, davidj...@chromium.org, gogeral...@chromium.org, hanxi...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org
Attention needed from Calder Kitagawa

Hitarth Kothari voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Calder Kitagawa
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic9eec323a4fa92cf69908d42734e6fe91746bece
Gerrit-Change-Number: 7487730
Gerrit-PatchSet: 2
Gerrit-Owner: Hitarth Kothari <hitarth...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Hitarth Kothari <hitarth...@google.com>
Gerrit-Attention: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Comment-Date: Thu, 15 Jan 2026 20:07:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Jan 15, 2026, 4:21:40 PM (2 days ago) Jan 15
to Hitarth Kothari, Calder Kitagawa, chromium...@chromium.org, davidj...@chromium.org, gogeral...@chromium.org, hanxi...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org

Chromium LUCI CQ submitted the change with unreviewed changes

Unreviewed changes

1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetManagerTest.java
Insertions: 5, Deletions: 128.

@@ -4,13 +4,14 @@

package org.chromium.chrome.browser.tasks.tab_management.tab_bottom_sheet;

-import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

+import android.widget.FrameLayout;
+
import androidx.test.core.app.ApplicationProvider;

import org.junit.After;
@@ -29,12 +30,8 @@
import org.chromium.base.test.util.Features.DisableFeatures;
import org.chromium.base.test.util.Features.EnableFeatures;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
-import org.chromium.chrome.browser.tab.Tab;
-import org.chromium.chrome.browser.tab.TabSelectionType;
-import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModelObserver;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
-import org.chromium.url.JUnitTestGURLs;

/** Unit tests for {@link TabBottomSheetManager}. */
@RunWith(BaseRobolectricTestRunner.class)
@@ -43,12 +40,6 @@
public class TabBottomSheetManagerTest {
@Rule public MockitoRule mMockitoRule = MockitoJUnit.rule();
@Mock private BottomSheetController mMockBottomSheetController;
- @Mock private TabModel mMockRegularTabModel;
- @Mock private Tab mMockNtpTab;
- @Mock private Tab mMockIncognitoTab;
- @Mock private Tab mMockOtherTab;
- @Mock private Tab mMockClosingTab;
- @Mock private Tab mMockHiddenTab;
@Mock private TabBottomSheetToolbar mMockToolbar;

@Captor private ArgumentCaptor<TabModelObserver> mTabModelObserverCaptor;
@@ -57,35 +48,9 @@

@Before
public void setUp() {
- // Setup for a generic NTP tab
- when(mMockNtpTab.isIncognitoBranded()).thenReturn(false);
- when(mMockNtpTab.getUrl()).thenReturn(JUnitTestGURLs.NTP_URL);
- when(mMockNtpTab.isClosing()).thenReturn(false);
- when(mMockNtpTab.isHidden()).thenReturn(false);
-
- // Setup for an incognito tab
- when(mMockIncognitoTab.isIncognitoBranded()).thenReturn(true);
- when(mMockIncognitoTab.getUrl()).thenReturn(JUnitTestGURLs.NTP_URL);
- when(mMockIncognitoTab.isClosing()).thenReturn(false);
- when(mMockIncognitoTab.isHidden()).thenReturn(false);
-
- // Setup for another regular tab (non-NTP)
- when(mMockOtherTab.isIncognitoBranded()).thenReturn(false);
- when(mMockOtherTab.getUrl()).thenReturn(JUnitTestGURLs.URL_1);
- when(mMockOtherTab.isClosing()).thenReturn(false);
- when(mMockOtherTab.isHidden()).thenReturn(false);
-
- // Setup for a closing tab
- when(mMockClosingTab.isIncognitoBranded()).thenReturn(false);
- when(mMockClosingTab.getUrl()).thenReturn(JUnitTestGURLs.NTP_URL);
- when(mMockClosingTab.isClosing()).thenReturn(true);
- when(mMockClosingTab.isHidden()).thenReturn(false);
-
- // Setup for a hidden tab
- when(mMockHiddenTab.isIncognitoBranded()).thenReturn(false);
- when(mMockHiddenTab.getUrl()).thenReturn(JUnitTestGURLs.NTP_URL);
- when(mMockHiddenTab.isClosing()).thenReturn(false);
- when(mMockHiddenTab.isHidden()).thenReturn(true);
+ // Setup generic toolbar
+ when(mMockToolbar.getToolbarView())
+ .thenReturn(new FrameLayout(ApplicationProvider.getApplicationContext()));
}

@After
@@ -103,19 +68,6 @@
}

@Test
- public void testConstructor_FeatureEnabled_AddsObserver() {
- createManager();
- verify(mMockRegularTabModel).addObserver(any(TabModelObserver.class));
- }
-
- @Test
- @DisableFeatures({ChromeFeatureList.TAB_BOTTOM_SHEET})
- public void testConstructor_FeatureDisabled_NoObserverAdded() {
- createManager();
- verify(mMockRegularTabModel, never()).addObserver(any(TabModelObserver.class));
- }
-
- @Test
public void testTryToShowBottomSheet_FeatureEnabled_ShowsBottomSheet() {
createManager();
mManager.tryToShowBottomSheet(mMockToolbar);
@@ -129,79 +81,4 @@
mManager.tryToShowBottomSheet(mMockToolbar);
verify(mMockBottomSheetController, never()).requestShowContent(any(), anyBoolean());
}
-
- @Test
- public void testOnDidSelectTab_NtpTabFeatureEnabled_ShowsBottomSheet() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
- TabModelObserver observer = mTabModelObserverCaptor.getValue();
-
- observer.didSelectTab(mMockNtpTab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
-
- verify(mMockBottomSheetController).requestShowContent(any(), anyBoolean());
- }
-
- @Test
- public void testOnDidSelectTab_IncognitoTab_NoBottomSheet() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
- TabModelObserver observer = mTabModelObserverCaptor.getValue();
-
- observer.didSelectTab(mMockIncognitoTab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
-
- verify(mMockBottomSheetController, never()).requestShowContent(any(), anyBoolean());
- }
-
- @Test
- public void testOnDidSelectTab_NonNtpTab_NoBottomSheet() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
- TabModelObserver observer = mTabModelObserverCaptor.getValue();
-
- observer.didSelectTab(mMockOtherTab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
-
- verify(mMockBottomSheetController, never()).requestShowContent(any(), anyBoolean());
- }
-
- @Test
- public void testOnDidSelectTab_ClosingTab_NoBottomSheet() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
- TabModelObserver observer = mTabModelObserverCaptor.getValue();
-
- observer.didSelectTab(mMockClosingTab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
-
- verify(mMockBottomSheetController, never()).requestShowContent(any(), anyBoolean());
- }
-
- @Test
- public void testOnDidSelectTab_HiddenTab_NoBottomSheet() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
- TabModelObserver observer = mTabModelObserverCaptor.getValue();
-
- observer.didSelectTab(mMockHiddenTab, TabSelectionType.FROM_USER, Tab.INVALID_TAB_ID);
-
- verify(mMockBottomSheetController, never()).requestShowContent(any(), anyBoolean());
- }
-
- @Test
- public void testDestroy_RemovesObserverAndDestroysCoordinator() {
- createManager();
- verify(mMockRegularTabModel).addObserver(mTabModelObserverCaptor.capture());
-
- mManager.destroy();
-
- verify(mMockRegularTabModel).removeObserver(mTabModelObserverCaptor.getValue());
- assertNull(mManager.getTabBottomSheetCoordinatorForTesting());
- }
-
- @Test
- @DisableFeatures({ChromeFeatureList.TAB_BOTTOM_SHEET})
- public void testDestroy_FeatureDisabled_NoExtraActions() {
- createManager();
- verify(mMockRegularTabModel, never()).addObserver(any(TabModelObserver.class));
- mManager.destroy();
- assertNull(mManager.getTabBottomSheetCoordinatorForTesting());
- }
}
```
```
The name of the file: chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetCoordinatorTest.java
Insertions: 10, Deletions: 3.

@@ -16,8 +16,10 @@
import static org.mockito.Mockito.when;

import android.app.Activity;
+import android.widget.FrameLayout;

import androidx.annotation.Nullable;
+import androidx.test.core.app.ApplicationProvider;

import org.junit.After;
import org.junit.Before;
@@ -47,6 +49,7 @@
@Rule public MockitoRule mMockitoRule = MockitoJUnit.rule();

@Mock private BottomSheetController mMockBottomSheetController;
+ @Mock private TabBottomSheetToolbar mMockToolbar;
@Captor private ArgumentCaptor<TabBottomSheetContent> mBottomSheetContentArgumentCaptor;
@Captor private ArgumentCaptor<BottomSheetObserver> mBottomSheetObserverArgumentCaptor;

@@ -61,6 +64,10 @@

mCoordinator = new TabBottomSheetCoordinator(mActivity, mMockBottomSheetController);
mCoordinatorModel = mCoordinator.getModelForTesting();
+
+ // Setup generic toolbar
+ when(mMockToolbar.getToolbarView())
+ .thenReturn(new FrameLayout(ApplicationProvider.getApplicationContext()));
}

@After
@@ -78,7 +85,7 @@
private BottomSheetObserver simulateShowSuccessAndGetObserver() {
when(mMockBottomSheetController.requestShowContent(any(BottomSheetContent.class), eq(true)))
.thenReturn(true);
- mCoordinator.showBottomSheet(/* tabBottomSheetMode= */ TabBottomSheetModes.SIMPLE);
+ mCoordinator.showBottomSheet(mMockToolbar);
verify(mMockBottomSheetController)
.addObserver(mBottomSheetObserverArgumentCaptor.capture());
BottomSheetObserver coordinatorObserver = mBottomSheetObserverArgumentCaptor.getValue();
@@ -114,7 +121,7 @@
public void testShowBottomSheet_Fails_Cleanup() {
when(mMockBottomSheetController.requestShowContent(any(BottomSheetContent.class), eq(true)))
.thenReturn(false);
- mCoordinator.showBottomSheet(/* tabBottomSheetMode= */ TabBottomSheetModes.SIMPLE);
+ mCoordinator.showBottomSheet(mMockToolbar);
verify(mMockBottomSheetController)
.requestShowContent(any(BottomSheetContent.class), eq(true));
verify(mMockBottomSheetController, never()).addObserver(any(BottomSheetObserver.class));
@@ -144,7 +151,7 @@
public void testDestroy_WhenNotShown_CleansUp() {
when(mMockBottomSheetController.requestShowContent(any(BottomSheetContent.class), eq(true)))
.thenReturn(false);
- mCoordinator.showBottomSheet(/* tabBottomSheetMode= */ TabBottomSheetModes.SIMPLE);
+ mCoordinator.showBottomSheet(mMockToolbar);
mCoordinator.destroy();

verify(mMockBottomSheetController, never()).hideContent(any(), anyBoolean(), anyInt());
```

Change information

Commit message:
[TabBottomSheet] Restructure files
Bug: 476103594
Change-Id: Ic9eec323a4fa92cf69908d42734e6fe91746bece
Auto-Submit: Hitarth Kothari <hitarth...@google.com>
Reviewed-by: Calder Kitagawa <ckit...@chromium.org>
Commit-Queue: Hitarth Kothari <hitarth...@google.com>
Cr-Commit-Position: refs/heads/main@{#1569982}
Files:
  • M chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetCoordinator.java
  • M chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetCoordinatorTest.java
  • M chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetManager.java
  • M chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetManagerTest.java
  • A chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetSimpleManager.java
  • D chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetToolbarContainer.java
  • D chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetToolbarContainerTest.java
  • M chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/tab_bottom_sheet/TabBottomSheetUtils.java
  • M chrome/android/features/tab_ui/tab_management_java_sources.gni
  • M chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
  • M chrome/android/junit/BUILD.gn
Change size: L
Delta: 11 files changed, 133 insertions(+), 333 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Calder Kitagawa
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic9eec323a4fa92cf69908d42734e6fe91746bece
Gerrit-Change-Number: 7487730
Gerrit-PatchSet: 3
Gerrit-Owner: Hitarth Kothari <hitarth...@google.com>
Gerrit-Reviewer: Calder Kitagawa <ckit...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Hitarth Kothari <hitarth...@google.com>
open
diffy
satisfied_requirement

Chrome Crash (Prod) (Gerrit)

unread,
3:08 AM (10 hours ago) 3:08 AM
to Chromium LUCI CQ, Hitarth Kothari, Calder Kitagawa, chromium...@chromium.org, davidj...@chromium.org, gogeral...@chromium.org, hanxi...@chromium.org, mattsimm...@chromium.org, meilian...@chromium.org, wychen...@chromium.org, yuezhang...@chromium.org, yusufo...@chromium.org

Chrome Crash (Prod) has created a revert of this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: revert
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages