Refactor DaemonControllerDelegateWin for testing [chromium/src : main]

0 views
Skip to first unread message

Joe Downing (Gerrit)

unread,
Apr 22, 2026, 6:27:56 PM (2 days ago) Apr 22
to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Yuwei Huang

Joe Downing added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Joe Downing . resolved

PTAL!

Open in Gerrit

Related details

Attention is currently required from:
  • Yuwei Huang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I4aecf278a4d988ae69827b59f0b8ce44327483d3
Gerrit-Change-Number: 7779797
Gerrit-PatchSet: 7
Gerrit-Owner: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
Gerrit-Attention: Yuwei Huang <yuw...@chromium.org>
Gerrit-Comment-Date: Wed, 22 Apr 2026 22:27:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yuwei Huang (Gerrit)

unread,
Apr 22, 2026, 7:53:32 PM (2 days ago) Apr 22
to Joe Downing, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org
Attention needed from Joe Downing

Yuwei Huang voted and added 3 comments

Votes added by Yuwei Huang

Code-Review+1

3 comments

File remoting/host/setup/daemon_controller_delegate_win.cc
Line 318, Patchset 7 (Latest): : config_dir_(remoting::GetConfigDir()) {}
Yuwei Huang . unresolved

nit: `remoting::` is probably not needed here.

File remoting/host/setup/daemon_controller_delegate_win_unittest.cc
Line 53, Patchset 7 (Latest): config.Set("host_id", "test_host_id");
Yuwei Huang . unresolved

Consider using the `kHostIdConfigPath` constant here instead of the magic string `\"host_id\"` to stay consistent with the rest of the codebase.

Line 78, Patchset 7 (Latest): new_config.Set("host_id", "new_host_id");
Yuwei Huang . unresolved

Same here: consider using `kHostIdConfigPath` instead of a string literal.

Open in Gerrit

Related details

Attention is currently required from:
  • Joe Downing
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I4aecf278a4d988ae69827b59f0b8ce44327483d3
    Gerrit-Change-Number: 7779797
    Gerrit-PatchSet: 7
    Gerrit-Owner: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
    Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
    Gerrit-Attention: Joe Downing <joe...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Apr 2026 23:53:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joe Downing (Gerrit)

    unread,
    Apr 22, 2026, 7:59:45 PM (2 days ago) Apr 22
    to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

    Joe Downing voted and added 4 comments

    Votes added by Joe Downing

    Commit-Queue+2

    4 comments

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Joe Downing . resolved

    Thanks!

    File remoting/host/setup/daemon_controller_delegate_win.cc
    Line 318, Patchset 7: : config_dir_(remoting::GetConfigDir()) {}
    Yuwei Huang . resolved

    nit: `remoting::` is probably not needed here.

    Joe Downing

    Thanks! I found it used in a few other existing locations which I've removed as well.

    File remoting/host/setup/daemon_controller_delegate_win_unittest.cc
    Line 53, Patchset 7: config.Set("host_id", "test_host_id");
    Yuwei Huang . resolved

    Consider using the `kHostIdConfigPath` constant here instead of the magic string `\"host_id\"` to stay consistent with the rest of the codebase.

    Joe Downing

    Done

    Line 78, Patchset 7: new_config.Set("host_id", "new_host_id");
    Yuwei Huang . resolved

    Same here: consider using `kHostIdConfigPath` instead of a string literal.

    Joe Downing

    Done

    Open in Gerrit

    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: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4aecf278a4d988ae69827b59f0b8ce44327483d3
      Gerrit-Change-Number: 7779797
      Gerrit-PatchSet: 8
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Wed, 22 Apr 2026 23:59:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Yuwei Huang <yuw...@chromium.org>
      satisfied_requirement
      open
      diffy

      Joe Downing (Gerrit)

      unread,
      Apr 22, 2026, 8:23:14 PM (2 days ago) Apr 22
      to Yuwei Huang, Chromium LUCI CQ, chromium...@chromium.org, chromotin...@chromium.org

      Joe Downing voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      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: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4aecf278a4d988ae69827b59f0b8ce44327483d3
      Gerrit-Change-Number: 7779797
      Gerrit-PatchSet: 9
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Apr 2026 00:23:05 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Apr 22, 2026, 10:02:53 PM (2 days ago) Apr 22
      to Joe Downing, Yuwei Huang, chromium...@chromium.org, chromotin...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

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

      ```
      The name of the file: remoting/host/setup/daemon_controller_delegate_win.cc
      Insertions: 1, Deletions: 1.

      @@ -315,7 +315,7 @@
      } // namespace

      DaemonControllerDelegateWin::DaemonControllerDelegateWin()
      - : config_dir_(remoting::GetConfigDir()) {}
      + : config_dir_(GetConfigDir()) {}

      DaemonControllerDelegateWin::DaemonControllerDelegateWin(
      const base::FilePath& config_dir)
      ```
      ```
      The name of the file: remoting/host/setup/daemon_controller_delegate_win_unittest.cc
      Insertions: 2, Deletions: 2.

      @@ -50,7 +50,7 @@

      TEST_F(DaemonControllerDelegateWinTest, GetConfigReturnsUnprivilegedConfig) {
      base::DictValue config;
      - config.Set("host_id", "test_host_id");
      + config.Set(kHostIdConfigPath, "test_host_id");
      WriteUnprivilegedConfig(config);

      auto result = delegate_->GetConfig();
      @@ -75,7 +75,7 @@

      TEST_F(DaemonControllerDelegateWinTest, UpdateConfigFailsWhenNoFullConfig) {
      base::DictValue new_config;
      - new_config.Set("host_id", "new_host_id");
      + new_config.Set(kHostIdConfigPath, "new_host_id");

      bool callback_called = false;
      delegate_->UpdateConfig(
      ```

      Change information

      Commit message:
      Refactor DaemonControllerDelegateWin for testing

      Refactors to allow injecting a custom configuration directory for
      testing purposes. Adds an initial unit test to verify behavior.

      This refactoring is needed so we can add unit tests to verify a fix
      for a file-related issue.
      Bug: 501808060
      Change-Id: I4aecf278a4d988ae69827b59f0b8ce44327483d3
      Commit-Queue: Joe Downing <joe...@chromium.org>
      Reviewed-by: Yuwei Huang <yuw...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1619269}
      Files:
      • M remoting/host/BUILD.gn
      • M remoting/host/setup/daemon_controller_delegate_win.cc
      • M remoting/host/setup/daemon_controller_delegate_win.h
      • A remoting/host/setup/daemon_controller_delegate_win_unittest.cc
      Change size: M
      Delta: 4 files changed, 142 insertions(+), 9 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Yuwei Huang
      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: I4aecf278a4d988ae69827b59f0b8ce44327483d3
      Gerrit-Change-Number: 7779797
      Gerrit-PatchSet: 10
      Gerrit-Owner: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Joe Downing <joe...@chromium.org>
      Gerrit-Reviewer: Yuwei Huang <yuw...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages