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

Issue 9426029: Test file errors in downloads. (Closed)

Created:
8 years, 10 months ago by ahendrickson
Modified:
8 years, 9 months ago
CC:
chromium-reviews, achuith+watch_chromium.org, joi+watch-content_chromium.org, rginda+watch_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Test file errors in downloads. Uses an error injection technique to simulate hard-to-reproduce file system errors. BUG=None TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=126732

Patch Set 1 #

Patch Set 2 : Merged with parent #

Patch Set 3 : Fixed issues with errors occurring at start of download. #

Patch Set 4 : Merged with parent #

Patch Set 5 : Merged with parent #

Total comments: 12

Patch Set 6 : Rearchitected to avoid reference counting #

Patch Set 7 : Merged with parent #

Patch Set 8 : Simplified injector classes further. #

Total comments: 40

Patch Set 9 : Merged with trunk #

Patch Set 10 : Refactored per Chris' comments #

Total comments: 64

Patch Set 11 : Tests now use a callback to wait for DownloadItem to be created or error out. #

Patch Set 12 : Now running multiple downloads per test; using URL as identifier. #

Patch Set 13 : Split off 2 CLs, to simplify this one. #

Total comments: 47

Patch Set 14 : Merged with parent #

Total comments: 12

Patch Set 15 : Fixed CLANG issue. #

Total comments: 20

Patch Set 16 : Created DownloadId default constructor. Cleaned up per Chris' comments. #

Total comments: 2

Patch Set 17 : Merged with parent. #

Patch Set 18 : Added test that injects an error on the 2nd write. #

Total comments: 10

Patch Set 19 : InjectErrors now posts to the file thread. #

Patch Set 20 : Merged with parent. Removed unused variable. #

Total comments: 20

Patch Set 21 : Merged with parent. #

Patch Set 22 : Refactored per Chris & Randy's comments. #

Total comments: 19

Patch Set 23 : Merged with parent. #

Patch Set 24 : Changes per Chris' comments. #

Patch Set 25 : Addressed GCC compile issue. #

Patch Set 26 : Merged with parent. #

Patch Set 27 : Renamed loop body functions. #

Patch Set 28 : Merged with master. #

Patch Set 29 : Merged with trunk. #

Patch Set 30 : Fixed merge issue. #

Patch Set 31 : Removed interface class for download file error injector. #

Patch Set 32 : Added comment about dangling pointer. #

Patch Set 33 : Merged with trunk. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+950 lines, -118 lines) Patch
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 10 chunks +353 lines, -109 lines 0 comments Download
M content/browser/download/download_file_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +10 lines, -6 lines 0 comments Download
M content/browser/download/download_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 2 chunks +6 lines, -1 line 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/browser/download_id.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -2 lines 0 comments Download
A content/test/test_file_error_injector.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +148 lines, -0 lines 0 comments Download
A content/test/test_file_error_injector.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +419 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
ahendrickson
PTAL
8 years, 10 months ago (2012-02-23 23:59:30 UTC) #1
cbentzel
BUG and TEST? I haven't done any actual reviewing yet, http://codereview.chromium.org/9426029/diff/12003/content/test/test_file_error_injector.h File content/test/test_file_error_injector.h (right): http://codereview.chromium.org/9426029/diff/12003/content/test/test_file_error_injector.h#newcode12 ...
8 years, 10 months ago (2012-02-24 01:54:37 UTC) #2
cbentzel
It feels like this infrastructure could be simplified significantly - at least to make the ...
8 years, 10 months ago (2012-02-24 02:25:12 UTC) #3
ahendrickson
On 2012/02/24 02:25:12, cbentzel wrote: > It feels like this infrastructure could be simplified significantly ...
8 years, 10 months ago (2012-02-24 16:27:05 UTC) #4
cbentzel
On Fri, Feb 24, 2012 at 11:27 AM, <ahendrickson@chromium.org> wrote: > On 2012/02/24 02:25:12, cbentzel ...
8 years, 10 months ago (2012-02-24 16:31:07 UTC) #5
Randy Smith (Not in Mondays)
I'll wait to do my review until you've done the restructuring you and Chris worked ...
8 years, 10 months ago (2012-02-24 19:22:45 UTC) #6
ahendrickson
http://codereview.chromium.org/9426029/diff/12003/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/12003/chrome/browser/download/download_browsertest.cc#newcode308 chrome/browser/download/download_browsertest.cc:308: struct FileErrorInjectInfo { On 2012/02/24 02:25:12, cbentzel wrote: > ...
8 years, 10 months ago (2012-02-24 22:48:39 UTC) #7
cbentzel
Unfortunately, I lost my comment (must have marked cancel). This is still far more complicated ...
8 years, 10 months ago (2012-02-24 23:08:45 UTC) #8
ahendrickson
Please take a look -- I simplified it some more. The DownloadFileWithErrors now only have ...
8 years, 10 months ago (2012-02-25 01:08:20 UTC) #9
cbentzel
I still think this is a bit too complicated, but the complexity is at an ...
8 years, 10 months ago (2012-02-26 15:01:48 UTC) #10
cbentzel
http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc#newcode753 chrome/browser/download/download_browsertest.cc:753: // |injector| will be owned by the DownloadFileManager (indirectly). ...
8 years, 10 months ago (2012-02-27 02:18:54 UTC) #11
ahendrickson
http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc#newcode753 chrome/browser/download/download_browsertest.cc:753: // |injector| will be owned by the DownloadFileManager (indirectly). ...
8 years, 10 months ago (2012-02-28 03:28:55 UTC) #12
cbentzel
http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/28004/chrome/browser/download/download_browsertest.cc#newcode756 chrome/browser/download/download_browsertest.cc:756: injector->InjectError(0, // First DownloadFile created. On 2012/02/28 03:28:56, ahendrickson ...
8 years, 9 months ago (2012-02-28 10:57:28 UTC) #13
cbentzel
Getting closer. http://codereview.chromium.org/9426029/diff/20002/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/20002/chrome/browser/download/download_browsertest.cc#newcode750 chrome/browser/download/download_browsertest.cc:750: // |injector| will be owned by the ...
8 years, 9 months ago (2012-02-28 14:51:40 UTC) #14
Randy Smith (Not in Mondays)
I think we should pull John in at some point to give the test injection ...
8 years, 9 months ago (2012-02-28 22:06:12 UTC) #15
Randy Smith (Not in Mondays)
The last patch set added a lot of files for the callback interface; could that ...
8 years, 9 months ago (2012-02-28 22:06:47 UTC) #16
cbentzel
On 2012/02/28 22:06:47, rdsmith wrote: > The last patch set added a lot of files ...
8 years, 9 months ago (2012-02-29 19:13:24 UTC) #17
ahendrickson
I'll split off parts of this into other CLs soon. http://codereview.chromium.org/9426029/diff/20002/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/20002/chrome/browser/download/download_browsertest.cc#newcode750 ...
8 years, 9 months ago (2012-03-01 09:17:32 UTC) #18
ahendrickson
Forgot to update one comment. Here it is. http://codereview.chromium.org/9426029/diff/20002/content/test/test_file_error_injector.h File content/test/test_file_error_injector.h (right): http://codereview.chromium.org/9426029/diff/20002/content/test/test_file_error_injector.h#newcode27 content/test/test_file_error_injector.h:27: int ...
8 years, 9 months ago (2012-03-01 09:21:15 UTC) #19
ahendrickson
On 2012/02/29 19:13:24, cbentzel wrote: > On 2012/02/28 22:06:47, rdsmith wrote: > > The last ...
8 years, 9 months ago (2012-03-01 09:24:06 UTC) #20
ahendrickson
Split off 2 CLs.
8 years, 9 months ago (2012-03-01 09:55:02 UTC) #21
cbentzel
Please see the BUG in TestFileErrorInjectorImpl. Also, I am concerned that this isn't waiting long ...
8 years, 9 months ago (2012-03-01 15:44:20 UTC) #22
ahendrickson
http://codereview.chromium.org/9426029/diff/43020/content/browser/download/download_file_manager.h File content/browser/download/download_file_manager.h (right): http://codereview.chromium.org/9426029/diff/43020/content/browser/download/download_file_manager.h#newcode148 content/browser/download/download_file_manager.h:148: download_file_factory_.swap(file_factory); On 2012/03/01 15:44:20, cbentzel wrote: > What are ...
8 years, 9 months ago (2012-03-01 20:19:31 UTC) #23
Randy Smith (Not in Mondays)
I'm focussing on the error injection interface for the moment; I'll come back and evaluate ...
8 years, 9 months ago (2012-03-01 20:28:24 UTC) #24
cbentzel
http://codereview.chromium.org/9426029/diff/43020/content/browser/download/download_file_manager.h File content/browser/download/download_file_manager.h (right): http://codereview.chromium.org/9426029/diff/43020/content/browser/download/download_file_manager.h#newcode148 content/browser/download/download_file_manager.h:148: download_file_factory_.swap(file_factory); On 2012/03/01 20:19:31, ahendrickson wrote: > On 2012/03/01 ...
8 years, 9 months ago (2012-03-01 22:32:00 UTC) #25
cbentzel
http://codereview.chromium.org/9426029/diff/52001/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9426029/diff/52001/chrome/browser/download/download_browsertest.cc#newcode5 chrome/browser/download/download_browsertest.cc:5: #include <sstream> Why not just use stringprintf to create ...
8 years, 9 months ago (2012-03-02 20:07:57 UTC) #26
cbentzel
You were talking about doing some clean ups here with creating the factory early. If ...
8 years, 9 months ago (2012-03-02 20:45:19 UTC) #27
ahendrickson
http://codereview.chromium.org/9426029/diff/20002/content/test/test_file_error_injector.cc File content/test/test_file_error_injector.cc (right): http://codereview.chromium.org/9426029/diff/20002/content/test/test_file_error_injector.cc#newcode188 content/test/test_file_error_injector.cc:188: int counter = operation_counter_[code]; On 2012/02/28 14:51:41, cbentzel wrote: ...
8 years, 9 months ago (2012-03-02 21:58:46 UTC) #28
Randy Smith (Not in Mondays)
Comments on the injector interface. I'll go on to do the rest of the review, ...
8 years, 9 months ago (2012-03-06 23:05:19 UTC) #29
Randy Smith (Not in Mondays)
The non-error injection stuff looks basically good (nits below). Could you include a link to ...
8 years, 9 months ago (2012-03-07 22:19:29 UTC) #30
cbentzel
LGTM I'd like to see some of these issues I listed out addressed, but am ...
8 years, 9 months ago (2012-03-08 20:02:55 UTC) #31
ahendrickson
More to come . . . http://codereview.chromium.org/9426029/diff/43020/content/test/test_file_error_injector.cc File content/test/test_file_error_injector.cc (right): http://codereview.chromium.org/9426029/diff/43020/content/test/test_file_error_injector.cc#newcode35 content/test/test_file_error_injector.cc:35: typedef base::Callback<void(GURL url, ...
8 years, 9 months ago (2012-03-08 22:00:08 UTC) #32
ahendrickson
http://codereview.chromium.org/9426029/diff/68001/content/test/test_file_error_injector.cc File content/test/test_file_error_injector.cc (right): http://codereview.chromium.org/9426029/diff/68001/content/test/test_file_error_injector.cc#newcode133 content/test/test_file_error_injector.cc:133: void RecordDownloadFileConstruction(GURL url, content::DownloadId id); On 2012/03/08 20:02:55, cbentzel ...
8 years, 9 months ago (2012-03-09 16:58:05 UTC) #33
Randy Smith (Not in Mondays)
On 2012/03/07 22:19:29, rdsmith wrote: > The non-error injection stuff looks basically good (nits below). ...
8 years, 9 months ago (2012-03-12 01:24:26 UTC) #34
Randy Smith (Not in Mondays)
High level comments: * I'm good with you roping John in for his opinion on ...
8 years, 9 months ago (2012-03-12 01:44:49 UTC) #35
ahendrickson
On 2012/03/12 01:24:26, rdsmith wrote: > On 2012/03/07 22:19:29, rdsmith wrote: > > The non-error ...
8 years, 9 months ago (2012-03-12 11:37:00 UTC) #36
ahendrickson
http://codereview.chromium.org/9426029/diff/50005/content/test/test_file_error_injector.h File content/test/test_file_error_injector.h (right): http://codereview.chromium.org/9426029/diff/50005/content/test/test_file_error_injector.h#newcode70 content/test/test_file_error_injector.h:70: // Must be called before |InjectErrors()| for a particular ...
8 years, 9 months ago (2012-03-12 11:51:02 UTC) #37
Randy Smith (Not in Mondays)
LGTM, but do get John's review as well. http://codereview.chromium.org/9426029/diff/50005/content/test/test_file_error_injector.h File content/test/test_file_error_injector.h (right): http://codereview.chromium.org/9426029/diff/50005/content/test/test_file_error_injector.h#newcode70 content/test/test_file_error_injector.h:70: // ...
8 years, 9 months ago (2012-03-12 17:43:50 UTC) #38
ahendrickson
jam: PTAL at the file error injector code interface code.
8 years, 9 months ago (2012-03-12 18:13:21 UTC) #39
jam
On 2012/03/12 18:13:21, ahendrickson wrote: > jam: PTAL at the file error injector code interface ...
8 years, 9 months ago (2012-03-13 16:19:21 UTC) #40
ahendrickson
On 2012/03/13 16:19:21, John Abd-El-Malek wrote: > On 2012/03/12 18:13:21, ahendrickson wrote: > > jam: ...
8 years, 9 months ago (2012-03-13 16:22:47 UTC) #41
jam
On 2012/03/13 16:19:21, John Abd-El-Malek wrote: > On 2012/03/12 18:13:21, ahendrickson wrote: > > jam: ...
8 years, 9 months ago (2012-03-13 16:24:55 UTC) #42
jam
On 2012/03/13 16:22:47, ahendrickson wrote: > On 2012/03/13 16:19:21, John Abd-El-Malek wrote: > > On ...
8 years, 9 months ago (2012-03-13 16:27:24 UTC) #43
ahendrickson
I moved the implementation class declaration into the header, and removed the interface class. PTAL.
8 years, 9 months ago (2012-03-13 18:25:09 UTC) #44
jam
lgtm
8 years, 9 months ago (2012-03-14 00:50:17 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/9426029/101009
8 years, 9 months ago (2012-03-14 18:10:09 UTC) #46
commit-bot: I haz the power
8 years, 9 months ago (2012-03-14 21:14:30 UTC) #47
Change committed as 126732

Powered by Google App Engine
This is Rietveld 408576698