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

Issue 2952463002: App list sync unit tests (Closed)

Created:
3 years, 6 months ago by rcui
Modified:
3 years, 5 months ago
Reviewers:
xiyuan, stevenjb, khmel, jennyz
CC:
chromium-reviews, tfarina, Matt Giuca
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Tests that validate the merge and process functionality of AppListSyncableService with various kinds of good and bad data. BUG=645137 Review-Url: https://codereview.chromium.org/2952463002 Cr-Commit-Position: refs/heads/master@{#482092} Committed: https://chromium.googlesource.com/chromium/src/+/a2a65e1fa1e5c88feb43b1d0b3264c3764d0481b

Patch Set 1 #

Patch Set 2 : App list sync unit tests #

Total comments: 21

Patch Set 3 : App list sync unit tests #

Total comments: 4

Patch Set 4 : App list sync unit tests #

Total comments: 16

Patch Set 5 : App list sync unit tests #

Patch Set 6 : Add in dummy hooks for assistant settings launcher #

Unified diffs Side-by-side diffs Delta from patch set Stats (+491 lines, -3 lines) Patch
M chrome/app/settings_strings.grdp View 1 2 3 4 5 3 chunks +39 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/prefs_util.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/google_assistant_page/compiled_resources2.gyp View 1 2 3 4 5 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/google_assistant_page/google_assistant_browser_proxy.html View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/google_assistant_page/google_assistant_browser_proxy.js View 1 2 3 4 5 1 chunk +61 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html View 1 2 3 4 5 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/google_assistant_page/google_assistant_page.js View 1 2 3 4 5 1 chunk +73 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/route.js View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/search_page/search_page.html View 1 2 3 4 5 3 chunks +32 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/search_page/search_page.js View 1 2 3 4 5 3 chunks +28 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/settings_resources.grd View 1 2 3 4 5 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.h View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc View 1 2 3 4 5 1 chunk +75 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc View 1 2 3 4 5 4 chunks +28 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/settings/md_settings_ui.cc View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (14 generated)
rcui
3 years, 6 months ago (2017-06-21 00:13:24 UTC) #3
rcui
3 years, 6 months ago (2017-06-21 00:13:26 UTC) #4
rcui
3 years, 6 months ago (2017-06-21 00:13:27 UTC) #5
rcui
3 years, 6 months ago (2017-06-21 00:13:27 UTC) #6
rcui
3 years, 6 months ago (2017-06-21 00:13:27 UTC) #7
xiyuan
+stevenjb is probably the best person to review app list sync related code. Please format ...
3 years, 6 months ago (2017-06-21 15:59:20 UTC) #9
stevenjb
This is great, thanks for adding the additional test coverage! Definitely wait for khmel@, but ...
3 years, 6 months ago (2017-06-21 23:27:17 UTC) #10
khmel
Thanks for taking this problem! https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode93 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:93: sync_list.push_back(CreateAppRemoteData( In case id ...
3 years, 6 months ago (2017-06-22 00:10:12 UTC) #11
rcui
Thanks for the review! New patchset uploaded - ptal. https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode54 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:54: ...
3 years, 6 months ago (2017-06-23 02:03:49 UTC) #12
xiyuan
https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId = GenerateId("invalid_ordinals"); std::string is not allowed ...
3 years, 6 months ago (2017-06-23 17:11:34 UTC) #14
stevenjb
https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/20001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode95 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:95: "$$invalid_ordinal$$", "$$invalid_ordinal$$")); On 2017/06/23 02:03:48, rcui wrote: > On ...
3 years, 6 months ago (2017-06-23 19:46:05 UTC) #15
rcui
https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId = GenerateId("invalid_ordinals"); On 2017/06/23 19:46:05, stevenjb ...
3 years, 6 months ago (2017-06-23 21:28:08 UTC) #16
rcui
https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/40001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId = GenerateId("invalid_ordinals"); On 2017/06/23 21:28:08, rcui ...
3 years, 6 months ago (2017-06-23 21:28:42 UTC) #17
stevenjb
lgtm
3 years, 6 months ago (2017-06-23 21:29:50 UTC) #18
xiyuan
lgtm
3 years, 6 months ago (2017-06-23 22:31:19 UTC) #19
khmel
lgtm https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId() { nit: it seems const ...
3 years, 6 months ago (2017-06-23 22:37:27 UTC) #20
rcui
https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId() { On 2017/06/23 22:37:27, khmel wrote: ...
3 years, 6 months ago (2017-06-24 00:19:11 UTC) #27
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/2952463002/80001
3 years, 6 months ago (2017-06-24 00:20:05 UTC) #30
khmel
https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right): https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc#newcode61 chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:61: const std::string kInvalidOrdinalsId() { On 2017/06/24 00:19:10, rcui wrote: ...
3 years, 6 months ago (2017-06-24 00:30:16 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/a2a65e1fa1e5c88feb43b1d0b3264c3764d0481b
3 years, 6 months ago (2017-06-24 00:37:24 UTC) #34
rcui
3 years, 6 months ago (2017-06-24 01:01:54 UTC) #35
Message was sent while issue was closed.
https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_l...
File chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc (right):

https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_l...
chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:370:
EXPECT_EQ("item_name1x", GetSyncItem(kItemId1)->item_name);
On 2017/06/24 00:30:16, khmel wrote:
> On 2017/06/24 00:19:10, rcui wrote:
> > On 2017/06/23 22:37:27, khmel wrote:
> > > nit: It seems you frequently use this pattern. If you want you may add
some
> > > helper protected method (not forcing to do this):
> > > 
> > > void ValidateSyncItem(const std::string& id,
> > >                       const std::string& expected_name,....) {
> > > ...
> > > }
> > 
> > I went ahead and tried it, and the issue with this approach is it's hard to
> see
> > which part of the test the failed expectation (EXPECT, ASSERT) belongs to,
> > because all failures are reported as happening in ValidateSyncItem rather
than
> > its caller, and passing --gtest_throw_on_failure to the unit_test runner
> doesn't
> > work either.  Given it's a nice-to-have, I will go ahead without this. 
Would
> be
> > happy to hear ways around this if you know of any.
> 
> Usually this is not a problem.
> For example:
>
https://cs.chromium.org/chromium/src/chrome/browser/ui/app_list/arc/arc_app_u...

It does seem like it'll make tests harder to maintain.  Digging around, it looks
like SCOPED_TRACE might be the solution:
https://g3doc.corp.google.com/third_party/gtest/g3doc/advanced.md#adding-trac....
 Will try it out and upload a separate CL.

https://codereview.chromium.org/2952463002/diff/60001/chrome/browser/ui/app_l...
chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc:412:
ASSERT_TRUE(GetSyncItem(kItemId));
On 2017/06/24 00:30:16, khmel wrote:
> On 2017/06/24 00:19:11, rcui wrote:
> > On 2017/06/23 22:37:27, khmel wrote:
> > > nit: it would be nice to check that sync item was not modified after
> applying
> > > bad data.
> > 
> > Given the type of bad data we're using, the sync item would be modified, no?
> 
> Up to you, I just wanted  to see the use case when we apply bad data and sync
> item is not modified (bad data was ignored). If really bad data is applied
then
> we might have a problem where that data is used. 
> And if bad data is actually modifies the sync item we have to be sure that is
> modified way we expect.
> This is not a stopper for this cl.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698