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

Issue 2960103002: Improve add to homescreen data fetcher unit tests. (Closed)

Created:
3 years, 5 months ago by dominickn
Modified:
3 years, 5 months ago
Reviewers:
pkotwicz
CC:
chromium-reviews, dominickn+watch_chromium.org, pkotwicz+watch_chromium.org, zpeng+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve add to homescreen data fetcher unit tests. Existing tests for this component don't work. The service worker registration is for a different browser context, so the tests never actuallly verify WebAPK-compatibility properly. This CL revamps the tests by mocking out InstallableManager instead of WebContents. This allows precise control over the data returned to the data fetcher so we can verify more scenarios more accurately. BUG=721881 Review-Url: https://codereview.chromium.org/2960103002 Cr-Commit-Position: refs/heads/master@{#485505} Committed: https://chromium.googlesource.com/chromium/src/+/14dca19610d4b387af4f896d756f2cd9af5abf23

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rebase #

Total comments: 28

Patch Set 3 : Comments #

Patch Set 4 : Consolidation, testing calling GetData callback after time out #

Total comments: 45

Patch Set 5 : Comments #

Total comments: 10

Patch Set 6 : Comments #

Total comments: 11

Patch Set 7 : Comments #

Total comments: 7

Patch Set 8 : Comments #

Total comments: 4

Patch Set 9 : Comments #

Total comments: 6

Patch Set 10 : Rebase #

Patch Set 11 : Address nits #

Patch Set 12 : Re-rebase #

Patch Set 13 : Self nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -282 lines) Patch
M chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +280 lines, -242 lines 0 comments Download
M chrome/browser/installable/installable_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +39 lines, -6 lines 0 comments Download
M chrome/browser/installable/installable_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -34 lines 0 comments Download

Messages

Total messages: 62 (42 generated)
dominickn
Hey Peter, WDYT?
3 years, 5 months ago (2017-06-28 01:40:41 UTC) #4
pkotwicz
https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode158 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:158: params.check_installable ? is_installable_ : false}); For the sake of ...
3 years, 5 months ago (2017-06-28 18:17:03 UTC) #11
dominickn
High level comments: 1. these tests are cheap and fast, so they should check as ...
3 years, 5 months ago (2017-06-29 00:40:09 UTC) #12
pkotwicz
Some random thoughts: - In an ideal world, a given test would have just one ...
3 years, 5 months ago (2017-06-29 03:36:06 UTC) #17
dominickn
Updated as per our conversation, PTAL.
3 years, 5 months ago (2017-06-29 08:19:02 UTC) #20
pkotwicz
Mostly comment-related comments https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode322 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:322: Ping on this comment https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File ...
3 years, 5 months ago (2017-06-29 19:22:06 UTC) #23
dominickn
Thanks for the detailed review! https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/1/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode322 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:322: On 2017/06/29 19:22:05, pkotwicz ...
3 years, 5 months ago (2017-06-30 02:42:32 UTC) #25
pkotwicz
https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode154 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:154: if (!IsManifestValidForWebApp(manifest_)) Fair enough https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode169 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:169: (params.check_installable && should_installable_time_out_)) ...
3 years, 5 months ago (2017-06-30 23:54:53 UTC) #29
dominickn
https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode169 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:169: (params.check_installable && should_installable_time_out_)) { The initial manifest fetch is ...
3 years, 5 months ago (2017-07-05 07:03:26 UTC) #30
pkotwicz
https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode169 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:169: (params.check_installable && should_installable_time_out_)) { Because SetShouldInstallableTimeOut() takes precedence over ...
3 years, 5 months ago (2017-07-05 21:37:43 UTC) #35
dominickn
https://codereview.chromium.org/2960103002/diff/100001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/100001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode317 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:317: // Test a manifest with no icons. This should ...
3 years, 5 months ago (2017-07-06 01:44:01 UTC) #37
pkotwicz
I think that you missed a few comments from the previous patch set https://codereview.chromium.org/2960103002/diff/60001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File ...
3 years, 5 months ago (2017-07-06 02:03:16 UTC) #40
pkotwicz
Also you will need to merge with https://codereview.chromium.org/2968693003/ which landed an hour ago. Merging mostly ...
3 years, 5 months ago (2017-07-06 02:05:04 UTC) #41
dominickn
It is very difficult to follow up on comments on previous patchsets when there is ...
3 years, 5 months ago (2017-07-06 02:53:40 UTC) #42
pkotwicz
https://codereview.chromium.org/2960103002/diff/140001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/140001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode144 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:144: (params.check_installable && should_installable_time_out_)) { >>> Because SetShouldInstallableTimeOut() takes precedence ...
3 years, 5 months ago (2017-07-06 20:49:31 UTC) #43
dominickn
Thanks for picking these up. https://codereview.chromium.org/2960103002/diff/140001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/140001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode144 chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc:144: (params.check_installable && should_installable_time_out_)) { ...
3 years, 5 months ago (2017-07-10 02:37:44 UTC) #44
pkotwicz
LGTM with optional comment Thank you for bearing with me! https://codereview.chromium.org/2960103002/diff/160001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc File chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc (right): https://codereview.chromium.org/2960103002/diff/160001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc#newcode154 ...
3 years, 5 months ago (2017-07-10 21:14:40 UTC) #45
dominickn
Thanks for sticking through this! Rebased + nits addressed in the last two patchsets. https://codereview.chromium.org/2960103002/diff/160001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc ...
3 years, 5 months ago (2017-07-11 00:54:11 UTC) #48
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/2960103002/240001
3 years, 5 months ago (2017-07-11 02:55:31 UTC) #59
commit-bot: I haz the power
3 years, 5 months ago (2017-07-11 02:59:38 UTC) #62
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/14dca19610d4b387af4f896d756f...

Powered by Google App Engine
This is Rietveld 408576698