Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Issue 2138513002: arc: Use the new InstanceHolder for unittests (Closed)

Created:
4 years, 5 months ago by Luis Héctor Chávez
Modified:
4 years, 5 months ago
Reviewers:
hidehiko, stevenjb
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, tapted, Matt Giuca, tfarina, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/a/chromium/src.git@bridge_refactor_first
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

arc: Use the new InstanceHolder for unittests Instead of having unit tests go through Mojo and jump through hoops to ensure that all messages have propagated to all the threads, we can use the new arc::ArcBridgeService::InstanceHolder<T>::SetInstance() to directly set the concrete fake (and optional version). This simplifies testing quite a bit. BUG=626695 TEST=trybots Committed: https://crrev.com/c5fffc64c14a0464f8870bbe91df7e945f42c3ca Cr-Commit-Position: refs/heads/master@{#405138}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebased #

Patch Set 3 : git cl lint #

Total comments: 4

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -275 lines) Patch
M chrome/browser/ui/app_list/app_context_menu_unittest.cc View 1 2 5 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_test.cc View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_unittest.cc View 5 chunks +0 lines, -15 lines 0 comments Download
M components/arc/arc_bridge_service.h View 1 2 3 5 chunks +22 lines, -55 lines 0 comments Download
M components/arc/arc_bridge_service.cc View 1 2 3 2 chunks +0 lines, -131 lines 0 comments Download
M components/arc/arc_bridge_service_impl.h View 2 chunks +32 lines, -1 line 0 comments Download
M components/arc/arc_bridge_service_impl.cc View 1 chunk +133 lines, -1 line 0 comments Download
M components/arc/test/fake_app_instance.h View 2 chunks +0 lines, -19 lines 0 comments Download
M components/arc/test/fake_app_instance.cc View 2 chunks +1 line, -20 lines 0 comments Download
M components/arc/test/fake_notifications_instance.h View 1 2 3 chunks +4 lines, -6 lines 0 comments Download
M components/arc/test/fake_notifications_instance.cc View 2 chunks +2 lines, -9 lines 0 comments Download
M ui/arc/notification/arc_notification_manager_unittest.cc View 1 3 chunks +2 lines, -7 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 17 (4 generated)
Luis Héctor Chávez
PTAL This is the second (and last) part of the ArcBridgeService cleanup. It only saves ...
4 years, 5 months ago (2016-07-08 22:44:58 UTC) #2
hidehiko
Looks a good direction to me. Can I prioritize to review your first one? https://codereview.chromium.org/2138513002/diff/1/ui/arc/notification/arc_notification_manager_unittest.cc ...
4 years, 5 months ago (2016-07-11 06:05:18 UTC) #3
Luis Héctor Chávez
Sure, I just send this together to both provide mode context for the previous change ...
4 years, 5 months ago (2016-07-11 17:15:08 UTC) #4
stevenjb
c/b/ui lgtm
4 years, 5 months ago (2016-07-11 19:57:11 UTC) #5
hidehiko
https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc File components/arc/arc_bridge_service_impl.cc (right): https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc#newcode197 components/arc/arc_bridge_service_impl.cc:197: void ArcBridgeServiceImpl::OnAppInstanceReady(mojom::AppInstancePtr app_ptr) { As you moved ABHost to ...
4 years, 5 months ago (2016-07-12 18:27:36 UTC) #6
Luis Héctor Chávez
https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc File components/arc/arc_bridge_service_impl.cc (right): https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc#newcode197 components/arc/arc_bridge_service_impl.cc:197: void ArcBridgeServiceImpl::OnAppInstanceReady(mojom::AppInstancePtr app_ptr) { On 2016/07/12 18:27:36, hidehiko wrote: ...
4 years, 5 months ago (2016-07-12 18:34:06 UTC) #7
Luis Héctor Chávez
https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc File components/arc/arc_bridge_service_impl.cc (right): https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc#newcode197 components/arc/arc_bridge_service_impl.cc:197: void ArcBridgeServiceImpl::OnAppInstanceReady(mojom::AppInstancePtr app_ptr) { On 2016/07/12 18:34:06, Luis Héctor ...
4 years, 5 months ago (2016-07-12 22:14:29 UTC) #8
hidehiko
LGTM with assuming you'll work on separation of InstanceHolder in a follow up CL. https://codereview.chromium.org/2138513002/diff/40001/components/arc/arc_bridge_service_impl.cc ...
4 years, 5 months ago (2016-07-13 08:08:12 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2138513002/60001
4 years, 5 months ago (2016-07-13 13:49:04 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-07-13 14:01:56 UTC) #13
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 14:02:08 UTC) #14
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/c5fffc64c14a0464f8870bbe91df7e945f42c3ca Cr-Commit-Position: refs/heads/master@{#405138}
4 years, 5 months ago (2016-07-13 14:04:01 UTC) #16
engedy
4 years, 5 months ago (2016-07-13 15:50:49 UTC) #17
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/2146573005/ by engedy@chromium.org.

The reason for reverting is: Caused unit_tests failure on Linux ChromiumOS Tests
(1):

ArcAppModelBuilderTest.RemoveAppCleanUpFolder.

Powered by Google App Engine
This is Rietveld 408576698