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

Issue 10344024: Rewrite download manager unit to be actual unit tests. (Closed)

Created:
8 years, 7 months ago by Randy Smith (Not in Mondays)
Modified:
5 years ago
Reviewers:
asanka, jam
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, rginda+watch_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Rewrite download manager unit to be actual unit tests. Note that this isn't intended to be complete coverage; it's an attempt to preserve coverage from the old tests while making these "real" unit tests, i.e. with every class except for the main one being tested mocked. Thorough unit tests are intended for the future after we're more completely done with refactoring. BUG=107264 BUG=105200 BUG=110886 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=141674

Patch Set 1 #

Patch Set 2 : Rewrite basically done. #

Patch Set 3 : Sync'd to LKGR. #

Patch Set 4 : Fixed trybot problems? #

Patch Set 5 : A bit more cleanup. #

Patch Set 6 : Modified creation comment. #

Total comments: 22

Patch Set 7 : Incorporated John's comment. #

Total comments: 2

Patch Set 8 : Incorporated all comments (except John's on PS7) #

Patch Set 9 : Incorporate PS7 comment. #

Total comments: 5

Patch Set 10 : Incorporated comments. #

Patch Set 11 : Merged to LKGR. #

Patch Set 12 : Documented meaning of null factory argument to DM constructor. #

Patch Set 13 : Changed class decl to struct. #

Patch Set 14 : Fix try bot problem. #

Patch Set 15 : Sync'd to LKGR. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+640 lines, -1172 lines) Patch
M content/browser/browser_context.cc View 1 2 3 4 5 6 7 8 9 3 chunks +13 lines, -3 lines 0 comments Download
A content/browser/download/download_item_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +63 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 7 1 chunk +41 lines, -0 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +14 lines, -5 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 10 chunks +58 lines, -30 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +450 lines, -1134 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Randy Smith (Not in Mondays)
Asanka, could you take a look? Two caveats: * The rewrite of dmiu.cc is a ...
8 years, 6 months ago (2012-06-06 20:01:19 UTC) #1
jam
https://chromiumcodereview.appspot.com/10344024/diff/15001/content/browser/download/download_manager_impl.h File content/browser/download/download_manager_impl.h (right): https://chromiumcodereview.appspot.com/10344024/diff/15001/content/browser/download/download_manager_impl.h#newcode30 content/browser/download/download_manager_impl.h:30: class DownloadItemFactory { nit: can this be put in ...
8 years, 6 months ago (2012-06-07 03:21:45 UTC) #2
asanka
Looks much cleaner! https://chromiumcodereview.appspot.com/10344024/diff/15001/content/browser/download/download_manager_impl.cc File content/browser/download/download_manager_impl.cc (right): https://chromiumcodereview.appspot.com/10344024/diff/15001/content/browser/download/download_manager_impl.cc#newcode217 content/browser/download/download_manager_impl.cc:217: return new DownloadManagerImpl(delegate, file_manager, NULL, net_log); ...
8 years, 6 months ago (2012-06-07 17:04:53 UTC) #3
jam
http://codereview.chromium.org/10344024/diff/13002/content/browser/download/download_manager_impl.cc File content/browser/download/download_manager_impl.cc (right): http://codereview.chromium.org/10344024/diff/13002/content/browser/download/download_manager_impl.cc#newcode168 content/browser/download/download_manager_impl.cc:168: content::DownloadItem* DownloadItemFactoryImpl::CreatePersistedItem( this is personal style so feel free ...
8 years, 6 months ago (2012-06-07 21:35:40 UTC) #4
Randy Smith (Not in Mondays)
PTAL. High-level request for opinion: I recreated the DownloadManagerImpl::Create() function, so that I could allow ...
8 years, 6 months ago (2012-06-07 23:27:21 UTC) #5
jam
On 2012/06/07 23:27:21, rdsmith wrote: > PTAL. > > High-level request for opinion: I recreated ...
8 years, 6 months ago (2012-06-08 20:46:40 UTC) #6
Randy Smith (Not in Mondays)
On 2012/06/08 20:46:40, John Abd-El-Malek wrote: > On 2012/06/07 23:27:21, rdsmith wrote: > > PTAL. ...
8 years, 6 months ago (2012-06-08 21:27:31 UTC) #7
jabdelmalek
On 2012/06/08 21:27:31, rdsmith wrote: > On 2012/06/08 20:46:40, John Abd-El-Malek wrote: > > On ...
8 years, 6 months ago (2012-06-08 21:39:33 UTC) #8
Randy Smith (Not in Mondays)
On 2012/06/08 21:39:33, jabdelmalek wrote: > On 2012/06/08 21:27:31, rdsmith wrote: > > On 2012/06/08 ...
8 years, 6 months ago (2012-06-08 21:42:45 UTC) #9
Randy Smith (Not in Mondays)
On 2012/06/08 21:42:45, rdsmith wrote: > On 2012/06/08 21:39:33, jabdelmalek wrote: > > On 2012/06/08 ...
8 years, 6 months ago (2012-06-08 21:43:15 UTC) #10
jam
> > Hmmm. I don't mind consing up the download manager from a random place ...
8 years, 6 months ago (2012-06-08 21:57:03 UTC) #11
asanka
http://codereview.chromium.org/10344024/diff/5003/content/browser/download/download_manager_impl_unittest.cc File content/browser/download/download_manager_impl_unittest.cc (right): http://codereview.chromium.org/10344024/diff/5003/content/browser/download/download_manager_impl_unittest.cc#newcode132 content/browser/download/download_manager_impl_unittest.cc:132: explicit MockDownloadItemFactory(); Minor nit: no need for 'explicit' for ...
8 years, 6 months ago (2012-06-08 22:14:18 UTC) #12
Randy Smith (Not in Mondays)
On 2012/06/08 21:57:03, John Abd-El-Malek wrote: > > > Hmmm. I don't mind consing up ...
8 years, 6 months ago (2012-06-08 22:16:23 UTC) #13
Randy Smith (Not in Mondays)
PTAL. http://codereview.chromium.org/10344024/diff/5003/content/browser/download/download_manager_impl_unittest.cc File content/browser/download/download_manager_impl_unittest.cc (right): http://codereview.chromium.org/10344024/diff/5003/content/browser/download/download_manager_impl_unittest.cc#newcode132 content/browser/download/download_manager_impl_unittest.cc:132: explicit MockDownloadItemFactory(); On 2012/06/08 22:14:18, asanka wrote: > ...
8 years, 6 months ago (2012-06-09 17:32:39 UTC) #14
jam
On 2012/06/08 22:16:23, rdsmith wrote: > On 2012/06/08 21:57:03, John Abd-El-Malek wrote: > > > ...
8 years, 6 months ago (2012-06-11 05:34:22 UTC) #15
asanka
LGTM
8 years, 6 months ago (2012-06-11 17:51:51 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdsmith@chromium.org/10344024/13014
8 years, 6 months ago (2012-06-11 22:17:42 UTC) #17
commit-bot: I haz the power
Presubmit check for 10344024-13014 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 6 months ago (2012-06-11 22:17:51 UTC) #18
Randy Smith (Not in Mondays)
John, could I have your official LGTM for content/ (gypi files) and content/browser (browser_context.cc)?
8 years, 6 months ago (2012-06-12 02:08:14 UTC) #19
jam
lgtm
8 years, 6 months ago (2012-06-12 15:46:06 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdsmith@chromium.org/10344024/13014
8 years, 6 months ago (2012-06-12 15:47:12 UTC) #21
commit-bot: I haz the power
8 years, 6 months ago (2012-06-12 17:05:05 UTC) #22
Change committed as 141674

Powered by Google App Engine
This is Rietveld 408576698