Skip to content

Commit

Permalink
LSC Fix up multi-line and parameter comments in already mass-reformat…
Browse files Browse the repository at this point in the history
…ted directories

Specifically:
* //chrome/android/features
* //components/**/*Test.java
* //chrome/browser/**/*Test.java
* //chrome/android/javatests

See: https://docs.google.com/document/d/1XKHDXIlUP4p9tWQQnImCPhoKbXEgX-otdwEjX8G6SpQ/edit

Bug: 1491626
Change-Id: Ie11b5e2cf6283adcb275793070da0bfa0e6fa596
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4952944
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Sam Maier <smaier@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1212194}
  • Loading branch information
agrieve authored and Chromium LUCI CQ committed Oct 19, 2023
1 parent e1a8522 commit 92c06a0
Show file tree
Hide file tree
Showing 160 changed files with 1,381 additions and 1,444 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void testStartSurfaceOnTabletDisabled() throws IOException {
StartSurfaceTestUtils.waitForTabModel(mActivityTestRule.getActivity());

verifyTabCountAndActiveTabUrl(
mActivityTestRule.getActivity(), 1, TAB_URL, null /* expectHomeSurfaceUiShown */);
mActivityTestRule.getActivity(), 1, TAB_URL, /* expectHomeSurfaceUiShown= */ null);
}

@Test
Expand All @@ -125,7 +125,7 @@ public void testStartSurfaceOnTablet() throws IOException {
mActivityTestRule.getActivity(),
2,
UrlConstants.NTP_URL,
true /* expectHomeSurfaceUiShown */);
/* expectHomeSurfaceUiShown= */ true);
histogram.assertExpected();
}

Expand Down Expand Up @@ -153,7 +153,7 @@ public void testStartSurfaceOnTabletWithNtpExist() throws IOException {
mActivityTestRule.getActivity(),
3,
UrlConstants.NTP_URL,
true /* expectHomeSurfaceUiShown */);
/* expectHomeSurfaceUiShown= */ true);
histogram.assertExpected();
}

Expand Down Expand Up @@ -182,7 +182,7 @@ public void testStartSurfaceOnTabletWithActiveNtpExist() throws IOException {
mActivityTestRule.getActivity(),
2,
modifiedNtpUrl,
false /* expectHomeSurfaceUiShown */);
/* expectHomeSurfaceUiShown= */ false);
histogram.assertExpected();
}

Expand All @@ -198,7 +198,7 @@ public void testScrollableMvTilesEnabledOnTablet() throws IOException {
StartSurfaceTestUtils.waitForTabModel(cta);
// Verifies that a NTP is created and set as the current Tab.
verifyTabCountAndActiveTabUrl(
cta, 2, UrlConstants.NTP_URL, true /* expectHomeSurfaceUiShown */);
cta, 2, UrlConstants.NTP_URL, /* expectHomeSurfaceUiShown= */ true);

waitForNtpLoaded(cta.getActivityTab());
NewTabPage ntp = (NewTabPage) cta.getActivityTab().getNativePage();
Expand Down Expand Up @@ -240,7 +240,7 @@ public void testSingleTabCardGoneAfterTabClosed() throws IOException {

// Verifies that a new NTP is created and set as the active Tab.
verifyTabCountAndActiveTabUrl(
cta, 3, UrlConstants.NTP_URL, true /* expectHomeSurfaceUiShown */);
cta, 3, UrlConstants.NTP_URL, /* expectHomeSurfaceUiShown= */ true);
waitForNtpLoaded(cta.getActivityTab());

NewTabPage ntp = (NewTabPage) cta.getActivityTab().getNativePage();
Expand Down Expand Up @@ -288,7 +288,7 @@ public void testSingleTabModule() throws IOException {

// Verifies that a new NTP is created and set as the active Tab.
verifyTabCountAndActiveTabUrl(
cta, 3, UrlConstants.NTP_URL, true /* expectHomeSurfaceUiShown */);
cta, 3, UrlConstants.NTP_URL, /* expectHomeSurfaceUiShown= */ true);
waitForNtpLoaded(cta.getActivityTab());

NewTabPage ntp = (NewTabPage) cta.getActivityTab().getNativePage();
Expand Down Expand Up @@ -577,7 +577,7 @@ public void testClickSingleTabCardCloseNtpHomeSurface() throws IOException {

// Verifies that a new NTP is created and set as the active Tab.
verifyTabCountAndActiveTabUrl(
cta, 2, UrlConstants.NTP_URL, true /* expectHomeSurfaceUiShown */);
cta, 2, UrlConstants.NTP_URL, /* expectHomeSurfaceUiShown= */ true);
waitForNtpLoaded(cta.getActivityTab());

try {
Expand All @@ -588,7 +588,7 @@ public void testClickSingleTabCardCloseNtpHomeSurface() throws IOException {
}

// Verifies that the last active Tab is showing, and NTP home surface is closed.
verifyTabCountAndActiveTabUrl(cta, 1, TAB_URL, null /* expectHomeSurfaceUiShown */);
verifyTabCountAndActiveTabUrl(cta, 1, TAB_URL, /* expectHomeSurfaceUiShown= */ null);
}

/**
Expand All @@ -607,7 +607,7 @@ public void testThumbnailRecaptureForSingleTabCardAfterMostRecentTabClosed()
StartSurfaceTestUtils.waitForTabModel(cta);
// Verifies that a new NTP is created and set as the active Tab.
verifyTabCountAndActiveTabUrl(
cta, 2, UrlConstants.NTP_URL, true /* expectHomeSurfaceUiShown */);
cta, 2, UrlConstants.NTP_URL, /* expectHomeSurfaceUiShown= */ true);
waitForNtpLoaded(cta.getActivityTab());

Tab lastActiveTab = cta.getCurrentTabModel().getTabAt(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void testShow_SingleAsHomepage_FromResumeShowStart() throws Exception {
TabUiTestHelper.verifyTabModelTabCount(cta, 0, 0);
assertTrue(cta.getLayoutManager().isLayoutVisible(getStartSurfaceLayoutType()));
TestThreadUtils.runOnUiThreadBlocking(
() -> cta.getTabCreator(true /*incognito*/).launchNTP());
() -> cta.getTabCreator(/* incognito= */ true).launchNTP());
TabUiTestHelper.verifyTabModelTabCount(cta, 0, 1);

// Simulates pressing the Android's home button and bringing Chrome to the background.
Expand Down Expand Up @@ -848,7 +848,7 @@ public void testNotShowIncognitoHomepage() {
cta.getLayoutManager()
.isLayoutVisible(StartSurfaceTestUtils.getStartSurfaceLayoutType()));
TestThreadUtils.runOnUiThreadBlocking(
() -> cta.getTabCreator(true /*incognito*/).launchNTP());
() -> cta.getTabCreator(/* incognito= */ true).launchNTP());
TabUiTestHelper.verifyTabModelTabCount(cta, 0, 1);

// Simulates pressing the home button. Incognito tab should stay and homepage shouldn't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1304,9 +1304,9 @@ public void exploreSurfaceInitializedAfterNativeInSinglePane() {
StartSurfaceMediator mediator =
createStartSurfaceMediatorWithoutInit(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
verify(mCarouselOrSingleTabSwitcherModuleController)
.addTabSwitcherViewObserver(
mCarouselTabSwitcherModuleVisibilityObserverCaptor.capture());
Expand Down Expand Up @@ -1338,9 +1338,9 @@ public void initializeStartSurfaceTopMargins() {

createStartSurfaceMediatorWithoutInit(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
assertThat(
mPropertyModel.get(TASKS_SURFACE_BODY_TOP_MARGIN),
equalTo(tasksSurfaceBodyTopMargin));
Expand All @@ -1365,9 +1365,9 @@ public void initializeStartSurfaceTopMargins_SurfacePolish() {

createStartSurfaceMediatorWithoutInit(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
assertThat(
mPropertyModel.get(TASKS_SURFACE_BODY_TOP_MARGIN),
equalTo(tasksSurfaceBodyTopMarginPolished));
Expand Down Expand Up @@ -1408,9 +1408,9 @@ public void testStartSurfaceTopMarginsWhenFeedGoneImprovementEnabled() {
StartSurfaceMediator mediator =
createStartSurfaceMediatorWithoutInit(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
assertThat(
mPropertyModel.get(TASKS_SURFACE_BODY_TOP_MARGIN),
equalTo(tasksSurfaceBodyTopMarginWithTab));
Expand Down Expand Up @@ -1450,9 +1450,9 @@ public void feedPlaceholderFromWarmStart() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ true,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
assertFalse(mediator.shouldShowFeedPlaceholder());

mPropertyModel.set(IS_EXPLORE_SURFACE_VISIBLE, true);
Expand Down Expand Up @@ -1562,9 +1562,9 @@ public void testInitializeLogoWhenShownHomepageWithFeedDisabled() throws Excepti
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
showHomepageAndVerify(mediator, StartSurfaceState.SHOWN_HOMEPAGE);

verify(mLogoContainerView).setVisibility(View.VISIBLE);
Expand All @@ -1587,9 +1587,9 @@ public void testNotInitializeLogoWhenShownHomepageWithFeedEnabled() throws Excep
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
showHomepageAndVerify(mediator, StartSurfaceState.SHOWN_HOMEPAGE);

verify(mLogoContainerView, times(0)).setVisibility(View.VISIBLE);
Expand All @@ -1608,9 +1608,9 @@ public void testInitializeLogoWhenSurfacePolishedMoveDownLogoEnabled() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
showHomepageAndVerify(mediator, StartSurfaceState.SHOWN_HOMEPAGE);

verify(mLogoContainerView).setVisibility(View.VISIBLE);
Expand All @@ -1629,9 +1629,9 @@ public void testNotInitializeLogoWhenSurfacePolishedMoveDownLogoDisabled() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
showHomepageAndVerify(mediator, StartSurfaceState.SHOWN_HOMEPAGE);

verify(mLogoContainerView, times(0)).setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -1952,7 +1952,7 @@ public void testShowAndOnHide() {

StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true, /* isRefactorEnabled */ true);
/* isStartSurfaceEnabled= */ true, /* isRefactorEnabled= */ true);
assertEquals(mInitializeMVTilesRunnable, mediator.getInitializeMVTilesRunnableForTesting());
assertEquals(mTabSwitcherModule, mediator.getTabSwitcherModuleForTesting());

Expand Down Expand Up @@ -1984,9 +1984,9 @@ public void testDefaultSearchEngineChanged() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ false,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace*/ false);
/* useMagicSpace= */ false);
showHomepageAndVerify(mediator, StartSurfaceState.SHOWN_HOMEPAGE);

mProfileSupplier.set(mProfile);
Expand Down Expand Up @@ -2019,9 +2019,9 @@ public void testObserverWithSurfacePolish() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ true,
/* isRefactorEnabled= */ true,
/* hadWarmStart= */ false,
/* useMagicSpace */ true);
/* useMagicSpace= */ true);
assertEquals(mInitializeMVTilesRunnable, mediator.getInitializeMVTilesRunnableForTesting());
assertNull(mediator.getTabSwitcherModuleForTesting());
assertNull(mediator.getControllerForTesting());
Expand Down Expand Up @@ -2092,9 +2092,9 @@ public void testShowAndOnHideWithSurfacePolish() {
StartSurfaceMediator mediator =
createStartSurfaceMediator(
/* isStartSurfaceEnabled= */ true,
/* isRefactorEnabled */ true,
/* isRefactorEnabled= */ true,
/* hadWarmStart= */ false,
/* useMagicSpace */ true);
/* useMagicSpace= */ true);
assertEquals(mInitializeMVTilesRunnable, mediator.getInitializeMVTilesRunnableForTesting());
assertNull(mediator.getTabSwitcherModuleForTesting());
assertNull(mediator.getControllerForTesting());
Expand Down Expand Up @@ -2159,8 +2159,8 @@ public void testUpdateStartSurfaceBackgroundColor() {

private StartSurfaceMediator createStartSurfaceMediator(boolean isStartSurfaceEnabled) {
return createStartSurfaceMediator(
isStartSurfaceEnabled, /* isRefactorEnabled */
false,
isStartSurfaceEnabled,
/* isRefactorEnabled= */ false,
/* hadWarmStart= */ false,
/* useMagicSpace= */ false);
}
Expand Down Expand Up @@ -2199,7 +2199,7 @@ private StartSurfaceMediator createStartSurfaceMediatorWithoutInit(
boolean hasTabSwitcherModule = isStartSurfaceEnabled && isRefactorEnabled && !useMagicSpace;
return new StartSurfaceMediator(
useMagicSpace ? null : mCarouselOrSingleTabSwitcherModuleController,
null /* tabSwitcherContainer */,
/* tabSwitcherContainer= */ null,
hasTabSwitcherModule ? mTabSwitcherModule : null,
mTabModelSelector,
!isStartSurfaceEnabled ? null : mPropertyModel,
Expand All @@ -2208,15 +2208,15 @@ private StartSurfaceMediator createStartSurfaceMediatorWithoutInit(
mActivity,
mBrowserControlsStateProvider,
mActivityStateChecker,
null /* TabCreatorManager */,
true /* excludeQueryTiles */,
/* tabCreatorManager= */ null,
/* excludeQueryTiles= */ true,
mStartSurfaceSupplier,
hadWarmStart,
isStartSurfaceEnabled ? mInitializeMVTilesRunnable : null,
mParentTabSupplier,
mLogoContainerView,
mBackPressManager,
null /* feedPlaceholderParentView */,
/* feedPlaceholderParentView= */ null,
mActivityLifecycleDispatcher,
mTabSwitcherClickHandler,
mProfileSupplier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void showAndHide_SurfacePolish() {
mTabModelSelector,
mTabListFaviconProvider,
mTabContentManager,
true /* isSurfacePolishEnabled */);
/* isSurfacePolishEnabled= */ true);

assertNotNull(mPropertyModel.get(FAVICON));
assertNotNull(mPropertyModel.get(CLICK_LISTENER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void testStartMarginWith1RowMvTiles() {
mTabModelSelector,
mTabListFaviconProvider,
mTab3,
true /* isScrollableMvtEnabled */,
/* isScrollableMvtEnabled= */ true,
null,
null,
null);
Expand Down Expand Up @@ -341,7 +341,7 @@ public void testStartMarginWith2RowMvTiles() {
mTabModelSelector,
mTabListFaviconProvider,
mTab3,
false /* isScrollableMvtEnabled */,
/* isScrollableMvtEnabled= */ false,
null,
null,
null);
Expand Down Expand Up @@ -384,7 +384,7 @@ public void testNoLateralMargin_SurfacePolish() {
mTabModelSelector,
mTabListFaviconProvider,
mTab3,
false /* isScrollableMvtEnabled */,
/* isScrollableMvtEnabled= */ false,
null,
tabContentManager,
null);
Expand All @@ -407,7 +407,7 @@ public void testSingleTabCardClickCallback() {
mTabModelSelector,
mTabListFaviconProvider,
mTab3,
false /* isScrollableMvtEnabled */,
/* isScrollableMvtEnabled= */ false,
callback,
null,
null);
Expand All @@ -431,7 +431,7 @@ public void testUpdateWithUiConfigChanges() {
mTabModelSelector,
mTabListFaviconProvider,
mTab3,
true /* isScrollableMvtEnabled */,
/* isScrollableMvtEnabled= */ true,
null,
mTabContentManager,
mUiConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void testSnapshotterFetcher() {
Mockito.when(mRecyclerView.computeHorizontalScrollOffset()).thenReturn(0);
ModelList modelList = new ModelList();
PropertyModel propertyModel1 = makePropertyModel(mTabFaviconFetcherA, false, false);
modelList.add(new ListItem(/*type*/ 0, propertyModel1));
modelList.add(new ListItem(/* type= */ 0, propertyModel1));
TabStripSnapshotter tabStripSnapshotter =
new TabStripSnapshotter(this::onModelTokenChange, modelList, mRecyclerView);

Expand All @@ -120,7 +120,7 @@ public void testSnapshotterFetcher() {
Assert.assertEquals(1, mTokenList.size());

PropertyModel propertyModel2 = makePropertyModel(mTabFaviconFetcherA, true, true);
modelList.add(new ListItem(/*type*/ 0, propertyModel2));
modelList.add(new ListItem(/* type= */ 0, propertyModel2));
Assert.assertEquals(2, mTokenList.size());
Assert.assertNotEquals(mTokenList.get(0), mTokenList.get(1));

Expand Down

0 comments on commit 92c06a0

Please sign in to comment.