New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 739118 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocked on:
issue 737148



Sign in to add a comment

Make components/arc/arc_session.cc unit-testable

Project Member Reported by yusukes@chromium.org, Jul 4 2017

Issue description

components/arc/arc_session.cc is getting larger. We need automated tests for that file to keep the code under control.
 
Blockedon: 737148
Had a quick meeting with hidehiko@. I'm going to implement this in the following steps:

1. Move socket creation code to session_manager ( issue 737148 ) to simplify arc_session.cc.
2. Add a small state transition library with full unit tests to components/arc/ to remove all the manual state transitions and switch-cases from arc_session.cc.
3. Refactor arc_session.cc with the library.
4. Mock out dbus and mojo calls in arc_session.cc to make it unit-testable.
5. Write a test. What we want to test here is if arc_session.cc generates a proper 'event' depending on the dbus/mojo IPC result.
6. Do the same as #2 for arc_session_runner.cc.

Do you have more details for 2.? Is there a way in which we can add compile-time guarantees a-la clang Thread-safety annotations?
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ffb2cc03eae5251fe02f7b9a226166c8f0a0748a

commit ffb2cc03eae5251fe02f7b9a226166c8f0a0748a
Author: Hidehiko Abe <hidehiko@chromium.org>
Date: Wed Nov 15 08:34:34 2017

Remove DoNothingInstanceStopped.

Simply replace it by EmptyVoidDBusMethodCallback.

BUG= 739118 
TEST=Ran build.

Change-Id: I2960a87e520b8a9e334414e12a4ba2df65af0a13
Reviewed-on: https://chromium-review.googlesource.com/770911
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516638}
[modify] https://crrev.com/ffb2cc03eae5251fe02f7b9a226166c8f0a0748a/components/arc/arc_session.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53c36fda37d3c5bca4bb9e245c76e3a36e7a8309

commit 53c36fda37d3c5bca4bb9e245c76e3a36e7a8309
Author: Hidehiko Abe <hidehiko@chromium.org>
Date: Wed Nov 15 13:35:22 2017

Prepare extracting ArcSessionImpl to a dedicated file.

This contains two changes.
- Introduce ArcSessionImpl::CreateDelegate().
  This splits the direct dependency from ArcSession to
  ArcSessionDelegateImpl. ArcSessionImpl has responsibility
  to proxy the call.
- Get rid of alias for StartArcInstanceResult from the
  interface of ArcSessionImpl.

BUG= 739118 
TEST=Ran build.

Change-Id: I7bc3f611279a2c942959cb0bf3effd47c131c31b
Reviewed-on: https://chromium-review.googlesource.com/771131
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516681}
[modify] https://crrev.com/53c36fda37d3c5bca4bb9e245c76e3a36e7a8309/components/arc/arc_session.cc

Cc: -hidehiko@chromium.org yusukes@chromium.org
Owner: hidehiko@chromium.org
Status: Started (was: Assigned)
Labels: -M-62 M-64
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/76f718c77398175a9ff9a47212ae7fc5b3b77ba7

commit 76f718c77398175a9ff9a47212ae7fc5b3b77ba7
Author: Hidehiko Abe <hidehiko@chromium.org>
Date: Tue Nov 21 17:51:14 2017

Add unittests for ArcSessionImpl.

BUG= 739118 
TEST=Ran bots.

Change-Id: Ic4c81c914974b8d860cc65bcbc6e5cc67695f3fe
Reviewed-on: https://chromium-review.googlesource.com/768618
Reviewed-by: Luis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Commit-Queue: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518299}
[modify] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/chromeos/dbus/fake_session_manager_client.cc
[modify] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/chromeos/dbus/fake_session_manager_client.h
[modify] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/BUILD.gn
[modify] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/arc_session_impl.cc
[modify] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/arc_session_impl.h
[add] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/arc_session_impl_unittest.cc
[add] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/test/fake_arc_bridge_host.cc
[add] https://crrev.com/76f718c77398175a9ff9a47212ae7fc5b3b77ba7/components/arc/test/fake_arc_bridge_host.h

Status: Fixed (was: Started)

Sign in to add a comment