Test Project, not intended to be merged. [chromium/src : main]

0 views
Skip to first unread message

Leo Zhao (Gerrit)

unread,
Sep 18, 2025, 12:34:25 PM (2 days ago) Sep 18
to chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org

Leo Zhao added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Leo Zhao . resolved

This CL is for the step "Now's a good time to upload a CL with what you have so far so you can get some early feedback." from Bling Onboarding Template.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I9cd7163a869926bc08618ee63583b91f5356177d
Gerrit-Change-Number: 6966997
Gerrit-PatchSet: 1
Gerrit-Owner: Leo Zhao <leo...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 16:34:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sourav Uttam Sinha (Gerrit)

unread,
Sep 18, 2025, 1:42:03 PM (2 days ago) Sep 18
to Leo Zhao, Tommy Martino, Sebastien S-G, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org
Attention needed from Leo Zhao, Sebastien S-G and Tommy Martino

Sourav Uttam Sinha added 7 comments

Patchset-level comments
Sourav Uttam Sinha . resolved

Great work! I'd also recommend adding some sort of test (unit/EG).

File ios/chrome/app/strings/ios_strings.grd
Line 7948, Patchset 1 (Latest): <message name="IDS_TEST_PROJECT_NOT_SIGNEDIN" desc="A message to indicate the user is not signed in" meaning="Used to info the user that he or she is not signed in.">
Sourav Uttam Sinha . unresolved

Did you mean inform*?

Line 7951, Patchset 1 (Latest): <message name="IDS_TEST_PROJECT_SIGNEDIN" desc="A message to indicate the user is signed in" meaning="Used to info the user that he or she is signed in.">
Sourav Uttam Sinha . unresolved

Same as above

File ios/chrome/browser/browser_view/ui_bundled/browser_coordinator.mm
Line 661, Patchset 1 (Latest):@property(nonatomic, strong) TestProjectCoordinator* testProjectCoordinator;
Sourav Uttam Sinha . unresolved

Add a comment

File ios/chrome/browser/shared/public/features/features.mm
Line 1153, Patchset 1 (Latest):BASE_FEATURE(kIOSAlternativeNewTabAction, base::FEATURE_ENABLED_BY_DEFAULT);
Sourav Uttam Sinha . unresolved

This should be DISABLED_BY_DEFAULT as mentioned in the comment above. To enable it for testing purposes, you can go to chrome://flags and enable it manually.

File ios/chrome/browser/test_project/ui/DEPS
Line 1, Patchset 1 (Latest):include_rules = [
Sourav Uttam Sinha . unresolved

Is this file necessary? If you don't plan to include any rules, you can remove it.

File ios/chrome/browser/test_project/ui/test_project_view_controller.mm
Line 38, Patchset 1 (Latest): if (signedIn) {
self.statusLabel.text = l10n_util::GetNSString(IDS_TEST_PROJECT_SIGNEDIN);
} else {
self.statusLabel.text =
l10n_util::GetNSString(IDS_TEST_PROJECT_NOT_SIGNEDIN);
}
Sourav Uttam Sinha . unresolved

Nit:

self.statusLabel.text =
signedIn ? l10n_util::GetNSString(IDS_TEST_PROJECT_SIGNEDIN)
: l10n_util::GetNSString(IDS_TEST_PROJECT_NOT_SIGNEDIN);
Open in Gerrit

Related details

Attention is currently required from:
  • Leo Zhao
  • Sebastien S-G
  • Tommy Martino
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9cd7163a869926bc08618ee63583b91f5356177d
    Gerrit-Change-Number: 6966997
    Gerrit-PatchSet: 1
    Gerrit-Owner: Leo Zhao <leo...@google.com>
    Gerrit-Reviewer: Sebastien S-G <se...@chromium.org>
    Gerrit-Reviewer: Sourav Uttam Sinha <sinha...@google.com>
    Gerrit-Reviewer: Tommy Martino <tmar...@chromium.org>
    Gerrit-Attention: Leo Zhao <leo...@google.com>
    Gerrit-Attention: Sebastien S-G <se...@chromium.org>
    Gerrit-Attention: Tommy Martino <tmar...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Sep 2025 17:41:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leo Zhao (Gerrit)

    unread,
    Sep 18, 2025, 4:05:05 PM (2 days ago) Sep 18
    to Sourav Uttam Sinha, Tommy Martino, Sebastien S-G, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org
    Attention needed from Sourav Uttam Sinha and Tommy Martino

    Leo Zhao added 6 comments

    File ios/chrome/app/strings/ios_strings.grd
    Line 7948, Patchset 1: <message name="IDS_TEST_PROJECT_NOT_SIGNEDIN" desc="A message to indicate the user is not signed in" meaning="Used to info the user that he or she is not signed in.">
    Sourav Uttam Sinha . resolved

    Did you mean inform*?

    Leo Zhao

    Done

    Line 7951, Patchset 1: <message name="IDS_TEST_PROJECT_SIGNEDIN" desc="A message to indicate the user is signed in" meaning="Used to info the user that he or she is signed in.">
    Sourav Uttam Sinha . resolved

    Same as above

    Leo Zhao

    Done

    File ios/chrome/browser/browser_view/ui_bundled/browser_coordinator.mm
    Line 661, Patchset 1:@property(nonatomic, strong) TestProjectCoordinator* testProjectCoordinator;
    Sourav Uttam Sinha . resolved

    Add a comment

    Leo Zhao

    Done

    File ios/chrome/browser/shared/public/features/features.mm
    Line 1153, Patchset 1:BASE_FEATURE(kIOSAlternativeNewTabAction, base::FEATURE_ENABLED_BY_DEFAULT);
    Sourav Uttam Sinha . resolved

    This should be DISABLED_BY_DEFAULT as mentioned in the comment above. To enable it for testing purposes, you can go to chrome://flags and enable it manually.

    Leo Zhao

    Done

    File ios/chrome/browser/test_project/ui/DEPS
    Line 1, Patchset 1:include_rules = [
    Sourav Uttam Sinha . resolved

    Is this file necessary? If you don't plan to include any rules, you can remove it.

    Leo Zhao

    Done

    File ios/chrome/browser/test_project/ui/test_project_view_controller.mm
    Line 38, Patchset 1: if (signedIn) {

    self.statusLabel.text = l10n_util::GetNSString(IDS_TEST_PROJECT_SIGNEDIN);
    } else {
    self.statusLabel.text =
    l10n_util::GetNSString(IDS_TEST_PROJECT_NOT_SIGNEDIN);
    }
    Sourav Uttam Sinha . resolved

    Nit:

    self.statusLabel.text =
    signedIn ? l10n_util::GetNSString(IDS_TEST_PROJECT_SIGNEDIN)
    : l10n_util::GetNSString(IDS_TEST_PROJECT_NOT_SIGNEDIN);
    Leo Zhao

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sourav Uttam Sinha
    • Tommy Martino
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: I9cd7163a869926bc08618ee63583b91f5356177d
    Gerrit-Change-Number: 6966997
    Gerrit-PatchSet: 2
    Gerrit-Owner: Leo Zhao <leo...@google.com>
    Gerrit-Reviewer: Sebastien S-G <se...@chromium.org>
    Gerrit-Reviewer: Sourav Uttam Sinha <sinha...@google.com>
    Gerrit-Reviewer: Tommy Martino <tmar...@chromium.org>
    Gerrit-Attention: Sourav Uttam Sinha <sinha...@google.com>
    Gerrit-Attention: Tommy Martino <tmar...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Sep 2025 20:05:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sourav Uttam Sinha <sinha...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leo Zhao (Gerrit)

    unread,
    Sep 18, 2025, 4:05:44 PM (2 days ago) Sep 18
    to Sebastien S-G, Sourav Uttam Sinha, Tommy Martino, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org
    Attention needed from Sourav Uttam Sinha and Tommy Martino

    Leo Zhao removed Sebastien S-G from this change

    Deleted Reviewers:
    • Sebastien S-G
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sourav Uttam Sinha
    • Tommy Martino
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: deleteReviewer
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9cd7163a869926bc08618ee63583b91f5356177d
    Gerrit-Change-Number: 6966997
    Gerrit-PatchSet: 2
    Gerrit-Owner: Leo Zhao <leo...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Leo Zhao (Gerrit)

    unread,
    Sep 19, 2025, 1:37:40 PM (21 hours ago) Sep 19
    to Sourav Uttam Sinha, Tommy Martino, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org
    Attention needed from Sourav Uttam Sinha and Tommy Martino

    Leo Zhao added 1 comment

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Leo Zhao . resolved

    EG test is added.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sourav Uttam Sinha
    • Tommy Martino
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: I9cd7163a869926bc08618ee63583b91f5356177d
    Gerrit-Change-Number: 6966997
    Gerrit-PatchSet: 3
    Gerrit-Owner: Leo Zhao <leo...@google.com>
    Gerrit-Reviewer: Sourav Uttam Sinha <sinha...@google.com>
    Gerrit-Reviewer: Tommy Martino <tmar...@chromium.org>
    Gerrit-Attention: Sourav Uttam Sinha <sinha...@google.com>
    Gerrit-Attention: Tommy Martino <tmar...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 17:37:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tommy Martino (Gerrit)

    unread,
    Sep 19, 2025, 2:21:30 PM (20 hours ago) Sep 19
    to Leo Zhao, Sourav Uttam Sinha, chromium...@chromium.org, feature-me...@chromium.org, ios-revie...@chromium.org, ios-r...@chromium.org, marq+...@chromium.org, srahim...@chromium.org
    Attention needed from Leo Zhao and Sourav Uttam Sinha

    Tommy Martino added 16 comments

    File ios/chrome/app/strings/ios_strings.grd
    Line 7948, Patchset 2: <message name="IDS_TEST_PROJECT_NOT_SIGNEDIN" desc="A message to indicate the user is not signed in" meaning="Used to inform the user that he or she is not signed in.">
    Tommy Martino . unresolved

    `meaning` is optional and not necessary/useful here. I would remove it.

    See here for more context on when you *would* want to use it: https://www.chromium.org/developers/design-documents/ui-localization/#use-message-meanings-to-disambiguate-strings

    File ios/chrome/browser/browser_view/ui_bundled/browser_coordinator.mm
    Line 664, Patchset 2:// The coordinator to show the user's auth status.
    @property(nonatomic, strong) TestProjectCoordinator* testProjectCoordinator;
    Tommy Martino . unresolved

    We don't use private (in `.mm`) properties anymore. There are a lot in this file, because this file is huge and really old, but for new ones we should just use ivars. (I think maybe the tutorial you're following also needs to be updated to say "add an ivar" rather than "add a property")

    You can add this below `_credentialImportCoordinator`.

    Ref: go/bling-best-practices#properties-and-instance-variables

    Line 1647, Patchset 2: _testProjectCoordinator = [[TestProjectCoordinator alloc]
    Tommy Martino . unresolved

    Is there a reason we need to create this as soon as `BrowserCoordinator` is created, or could we defer that work and only create it when `showPopupView` is called?

    File ios/chrome/browser/shared/public/commands/activity_service_commands.h
    Line 30, Patchset 2:// Show a popup view to indicate whether a user has signed in.
    Tommy Martino . unresolved

    nit: `Shows` (for consistency with the other commands in this file)

    File ios/chrome/browser/test_project/coordinator/test_project_coordinator.mm
    Line 20, Patchset 2: UINavigationController* _rootController;
    Tommy Martino . unresolved

    ChromeCoordinator has a `baseNavigationController` property, so this is redundant.

    Line 21, Patchset 2: TestProjectMediator* _mediator;
    Tommy Martino . unresolved

    As a rule, Objective-C ivars (and classes, functions, protocols, etc) should always have documentation comments.

    The Obj-C style guide is stricter than the C++ style guide in this sense; in C++ it is OK to omit comments when they add no value, while in Obj-C we generally still require *something* to be written. (I mention this distinction because you're going to see lots of places in the code where C++ classes have ivars or even methods without comments.)

    https://google.github.io/styleguide/objcguide.html#declaration-comments

    Line 24, Patchset 2:@synthesize baseNavigationController = _baseNavigationController;
    Tommy Martino . unresolved

    As with `_rootController`, I don't think you actually need to declare or explicitly set this (the parent class initializer should take care of it)

    Line 30, Patchset 2: TestProjectViewController* vc = [[TestProjectViewController alloc] init];
    Tommy Martino . unresolved

    As a rule, we prefer longer, more descriptive variable names and avoid abbreviations (except in common cases like "HTML"). I would call this `viewController`.

    https://google.github.io/styleguide/objcguide.html#naming

    Line 40, Patchset 2: AuthenticationServiceFactory::GetForProfile(
    browser->GetProfile()->GetOriginalProfile());
    Tommy Martino . unresolved

    We have to be careful about using `GetOriginalProfile`, because it means that if we're in incognito it will behave like a non-incognito profile. I like to always leave a comment explaining why we believe it's safe.

    Line 55, Patchset 2: completion:^{
    [weakSelf updateUserSigninStatus];
    }];
    Tommy Martino . unresolved

    Is it important that updateUserSigninStatus be called only after the VC is presented? Could we just trigger this synchronously?

    Line 74, Patchset 2: [self.baseViewController dismissViewControllerAnimated:YES completion:nil];
    Tommy Martino . unresolved

    This dismisses the UI, but the coordinator continues to exist. It would be better to do this work in `stop` and manage the lifetime in tandem with the parent coordinator.

    When the VC indicates (via the button tap) that it should be dismissed, we would signal to the parent coordinator (probably via a new delegate protocol). The parent coordinator would then both call `stop` on this coordinator and clean up the references to it.

    File ios/chrome/browser/test_project/coordinator/test_project_mediator.mm
    Line 13, Patchset 3 (Latest):// The authentication service to observe for sign-in status changes.
    @property(nonatomic, assign) AuthenticationService* authService;
    Tommy Martino . unresolved

    Same as in the coordinator, this should be an instance variable instead of a property.

    Line 23, Patchset 3 (Latest): DCHECK(authService);
    Tommy Martino . unresolved

    We mostly prefer `CHECK` rather than `DCHECK`, except in specific circumstances. (This changed a year or two ago; we used to use a lot more `DCHECK`s and you'll still find them in the codebase.)

    The difference between `CHECK` and `DCHECK` is that `CHECK` will induce a crash on all builds, while `DCHECK` will only induce a crash on debug builds (and I think Canary as well).

    We use `DCHECK` when the condition would be too expensive to compute in the real production app. We'll also use it when we have a specific reason we don't want the app to crash in production, but still would like to get a dump when it happens locally (e.g., sometimes we'll do this for a bug that's hard to reproduce but not super severe).

    In your case, if `authService` is null here, we *will* crash on line 36 below, and so making this a DCHECK doesn't even save a crash in production. It's actually better to crash here in a controlled way than to let the app keep running and eventually hit a use-after-free. Thus, this should be a `CHECK`.

    File ios/chrome/browser/test_project/test/test_project_egtest.mm
    Line 29, Patchset 3 (Latest): id<GREYMatcher> newTabButtonMatcher =
    grey_accessibilityID(kToolbarNewTabButtonIdentifier);

    GREYCondition* isButtonInteractable = [GREYCondition
    conditionWithName:@"Wait for New Tab Button to be Interactable"
    block:^BOOL {
    NSError* error = nil;
    [[EarlGrey selectElementWithMatcher:newTabButtonMatcher]
    assertWithMatcher:grey_interactable()
    error:&error];
    return error == nil;
    }];

    NSTimeInterval customTimeout = 5.0;
    BOOL buttonBecameInteractable =
    [isButtonInteractable waitWithTimeout:customTimeout pollInterval:0.1];

    GREYAssertTrue(
    buttonBecameInteractable,
    @"New Tab Button did not become interactable within %f seconds",
    customTimeout);
    Tommy Martino . unresolved

    You should hopefully never need to do this level of synchronization/testing/waiting/etc by hand; we have lots of useful utilities in the [ChromeEarlGrey](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/test/earl_grey/chrome_earl_grey.h) file.

    In this case I think `waitForMatcher` with a matcher for `grey_allOf(newTabButtonMatcher, grey_interactable())` should do the trick.

    Line 63, Patchset 3 (Latest): timeout:base::Seconds(5)];
    Tommy Martino . unresolved
    File ios/chrome/browser/test_project/ui/test_project_view_controller.mm
    Line 20, Patchset 3 (Latest): self.view.backgroundColor = [UIColor whiteColor];
    Tommy Martino . unresolved

    In general, prefer to use semantic color names from [this file](https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/common/ui/colors/semantic_color_names.h).

    `kBackgroundColor` would be a good choice here.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Leo Zhao
    • Sourav Uttam Sinha
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I9cd7163a869926bc08618ee63583b91f5356177d
      Gerrit-Change-Number: 6966997
      Gerrit-PatchSet: 3
      Gerrit-Owner: Leo Zhao <leo...@google.com>
      Gerrit-Reviewer: Sourav Uttam Sinha <sinha...@google.com>
      Gerrit-Reviewer: Tommy Martino <tmar...@chromium.org>
      Gerrit-Attention: Leo Zhao <leo...@google.com>
      Gerrit-Attention: Sourav Uttam Sinha <sinha...@google.com>
      Gerrit-Comment-Date: Fri, 19 Sep 2025 18:21:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages