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

Issue 2711033002: Fix Arc integration test. (Closed)

Created:
3 years, 10 months ago by lgcheng
Modified:
3 years, 9 months ago
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, yusukes+watch_chromium.org, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, sync-reviews_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix Arc integration test. After all the refactor/clean up of ArcSessionManager, clean up Arc sync integration test setup/shut down logic and stop confusing ArcSessionManager state machine with sync test profile. Minor cleanup for ArcPackageSyncDataTypeController. BUG=694261 TEST=Run sync_integration_test --gtest_filter=*Arc*. All Arc related tests passed. Review-Url: https://codereview.chromium.org/2711033002 Cr-Commit-Position: refs/heads/master@{#454692} Committed: https://chromium.googlesource.com/chromium/src/+/853b5ae0c2f47d981dd8b390d321a886e465c005

Patch Set 1 #

Total comments: 5

Patch Set 2 : Donnot touch instance_holder. #

Total comments: 3

Patch Set 3 : Remove ArcSessionManager dependency. #

Total comments: 2

Patch Set 4 : Rebase #

Total comments: 13

Patch Set 5 : Address hidehiko's comments. #

Total comments: 10

Patch Set 6 : Address hidehiko's comments. Rebase. #

Total comments: 5

Patch Set 7 : Nit fix. #

Total comments: 15

Patch Set 8 : Pure rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -91 lines) Patch
M chrome/browser/chromeos/profiles/profile_helper.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc View 1 2 3 4 5 6 2 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/sync/test/integration/sync_arc_package_helper.h View 1 2 3 4 5 4 chunks +1 line, -9 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_arc_package_helper.cc View 1 2 3 4 5 6 7 6 chunks +4 lines, -43 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc View 1 2 3 4 5 6 5 chunks +17 lines, -4 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc View 1 2 3 4 5 1 chunk +16 lines, -12 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h View 1 2 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc View 1 2 3 4 5 3 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc View 1 2 3 4 5 3 chunks +4 lines, -13 lines 0 comments Download

Messages

Total messages: 43 (20 generated)
lgcheng
Hi Luis, PTAL. Thanks! https://codereview.chromium.org/2711033002/diff/1/chrome/browser/chromeos/arc/arc_session_manager.cc File chrome/browser/chromeos/arc/arc_session_manager.cc (right): https://codereview.chromium.org/2711033002/diff/1/chrome/browser/chromeos/arc/arc_session_manager.cc#newcode233 chrome/browser/chromeos/arc/arc_session_manager.cc:233: profile_->GetPrefs()->SetBoolean(prefs::kArcDataRemoveRequested, false); state() is confused ...
3 years, 10 months ago (2017-02-22 23:36:44 UTC) #2
hidehiko
drive-by https://codereview.chromium.org/2711033002/diff/1/chrome/browser/chromeos/arc/arc_session_manager.cc File chrome/browser/chromeos/arc/arc_session_manager.cc (right): https://codereview.chromium.org/2711033002/diff/1/chrome/browser/chromeos/arc/arc_session_manager.cc#newcode233 chrome/browser/chromeos/arc/arc_session_manager.cc:233: profile_->GetPrefs()->SetBoolean(prefs::kArcDataRemoveRequested, false); On 2017/02/22 23:36:44, lgcheng wrote: > ...
3 years, 10 months ago (2017-02-23 06:31:45 UTC) #4
lgcheng
On 2017/02/23 06:31:45, hidehiko wrote: > drive-by > > https://codereview.chromium.org/2711033002/diff/1/chrome/browser/chromeos/arc/arc_session_manager.cc > File chrome/browser/chromeos/arc/arc_session_manager.cc (right): > ...
3 years, 10 months ago (2017-02-23 18:26:55 UTC) #5
lgcheng
https://codereview.chromium.org/2711033002/diff/20001/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc File chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc (right): https://codereview.chromium.org/2711033002/diff/20001/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc#newcode42 chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc:42: ArcAppListPrefsFactory::SetFactoryForSyncTest(); On 2017/02/23 06:31:45, hidehiko wrote: > This runs ...
3 years, 10 months ago (2017-02-23 18:27:05 UTC) #6
hidehiko
h https://codereview.chromium.org/2711033002/diff/20001/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc File chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc (right): https://codereview.chromium.org/2711033002/diff/20001/chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc#newcode42 chrome/browser/sync/test/integration/two_client_arc_package_sync_test.cc:42: ArcAppListPrefsFactory::SetFactoryForSyncTest(); On 2017/02/23 18:27:05, lgcheng wrote: > On ...
3 years, 10 months ago (2017-02-23 19:12:24 UTC) #7
lgcheng
Hi Luis, PTAL a quick look. In current update, I put test check in ArcAppListPrefs ...
3 years, 10 months ago (2017-02-23 22:03:32 UTC) #8
Luis Héctor Chávez
all right, this looks much better and less invasive! deferring to hidehiko@ (in case he ...
3 years, 10 months ago (2017-02-23 22:56:29 UTC) #9
lgcheng
Hi, hidehiko@ PTAL. Rebase includes: Kind of revert https://codereview.chromium.org/2708693002/ And swallow update in https://codereview.chromium.org/2702723002/ Let ...
3 years, 10 months ago (2017-02-24 01:31:20 UTC) #11
hidehiko
https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/chromeos/arc/arc_util.h File chrome/browser/chromeos/arc/arc_util.h (right): https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/chromeos/arc/arc_util.h#newcode38 chrome/browser/chromeos/arc/arc_util.h:38: void SetArcAllowedForSyncTesting(); I commented alternative approach, which this may ...
3 years, 10 months ago (2017-02-24 18:22:27 UTC) #12
lgcheng
PTAL. Thanks! https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/chromeos/arc/arc_util.h File chrome/browser/chromeos/arc/arc_util.h (right): https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/chromeos/arc/arc_util.h#newcode38 chrome/browser/chromeos/arc/arc_util.h:38: void SetArcAllowedForSyncTesting(); On 2017/02/24 18:22:26, hidehiko wrote: ...
3 years, 10 months ago (2017-02-25 01:40:39 UTC) #14
lgcheng
Hi hidehiko, Would you PTAL when having a moment? Thanks!
3 years, 9 months ago (2017-03-01 20:32:03 UTC) #15
hidehiko
https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc File chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc (right): https://codereview.chromium.org/2711033002/diff/80001/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc#newcode270 chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc:270: On 2017/02/25 01:40:38, lgcheng wrote: > On 2017/02/24 18:22:26, ...
3 years, 9 months ago (2017-03-02 17:45:39 UTC) #16
lgcheng
Hi Hidehiko, Address your comments and remove sync test flag in arc::utils while keep sync ...
3 years, 9 months ago (2017-03-02 23:45:10 UTC) #18
hidehiko
Thank you for clean up! LGTM with minor comments. https://codereview.chromium.org/2711033002/diff/140001/chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc File chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc (right): https://codereview.chromium.org/2711033002/diff/140001/chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc#newcode13 chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc:13: ...
3 years, 9 months ago (2017-03-03 12:55:56 UTC) #19
lgcheng
Hi Xiyuan PTAL c/b/c c/b/ui/app_list Hi Skym@ PTAL c/b/sync/test Thanks! https://codereview.chromium.org/2711033002/diff/140001/chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc File chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc (right): https://codereview.chromium.org/2711033002/diff/140001/chrome/browser/sync/test/integration/single_client_arc_package_sync_test.cc#newcode13 ...
3 years, 9 months ago (2017-03-03 18:39:53 UTC) #22
xiyuan
c/b/c c/b/ui/app_list lgtm
3 years, 9 months ago (2017-03-03 18:44:23 UTC) #23
skym
Thanks so much for fixing these test cases! Really appreciate it. c/b/sync/test lgtm. https://codereview.chromium.org/2711033002/diff/160001/chrome/browser/sync/test/integration/sync_arc_package_helper.cc File ...
3 years, 9 months ago (2017-03-03 19:44:59 UTC) #24
lgcheng
Thanks for review! skym@ Thanks for detail comments. I will discuss your concerns will hidehiko ...
3 years, 9 months ago (2017-03-03 21:13:01 UTC) #25
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/2711033002/160001
3 years, 9 months ago (2017-03-03 21:13:38 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-clang/builds/49954) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 9 months ago (2017-03-03 21:16:05 UTC) #30
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/2711033002/180001
3 years, 9 months ago (2017-03-03 22:36:57 UTC) #37
commit-bot: I haz the power
Committed patchset #8 (id:180001) as https://chromium.googlesource.com/chromium/src/+/853b5ae0c2f47d981dd8b390d321a886e465c005
3 years, 9 months ago (2017-03-03 22:41:32 UTC) #40
hidehiko
3 years, 9 months ago (2017-03-06 05:48:32 UTC) #41
Message was sent while issue was closed.
https://codereview.chromium.org/2711033002/diff/160001/chrome/browser/ui/app_...
File chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc (right):

https://codereview.chromium.org/2711033002/diff/160001/chrome/browser/ui/app_...
chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc:270: if
(!ArcAppListPrefsFactory::IsFactorySetForSyncTest()) {
On 2017/03/03 19:44:58, skym wrote:
> How come the other 3 places in this file that call
arc::ArcSessionManager::Get()
> don't need special handling?

Good catch. It should, IMHO.

https://codereview.chromium.org/2711033002/diff/160001/chrome/browser/ui/app_...
chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc:271:
arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
On 2017/03/03 21:13:01, lgcheng wrote:
> On 2017/03/03 19:44:58, skym wrote:
> > This seems like it would be more clean if you passed in a weak pointer to a
> pure
> > virtual interface into ArcAppListPrefs's constructor, WDYT?
> 
> This is because the life cycle for ArcAppListPrefs and ArcSessionManger is not
> strictly the same. I tried to do what you mentioned, but lead to more problems
> than it solves. 
> 
> Also, it seems there is no plan to make strict condition for life cycle for
the
> two object at this moment. 

As for life-time, there is a plan. crbug.com/672829.
Once it is solved, we can assume ASM is alive while this instance is alive.
WeakPtr is an option now, but considering the plan, just if check looks
acceptable for now? Or, we can clean up the WeakPtr later.

WDYT?

https://codereview.chromium.org/2711033002/diff/160001/chrome/browser/ui/app_...
chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc:272:
CHECK(arc_session_manager);
On 2017/03/03 21:13:01, lgcheng wrote:
> On 2017/03/03 19:44:58, skym wrote:
> > Is CHECK really the appropriate macro here?
> >
>
https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md...
> 
> Well I think hidehiko has his own reason for put the check here. But it seems
> that's out of the scope of this cl. This cl just excludes this code snippet
for
> ArcAppListPrefs created with sync test profile. 

Just historical reason, IIUC. So, DCHECK is preferred, I think.

Powered by Google App Engine
This is Rietveld 408576698