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

Issue 9568003: Fixed issue with DownloadTestObserver. (Closed)

Created:
8 years, 9 months ago by ahendrickson
Modified:
8 years, 9 months ago
CC:
chromium-reviews, rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Fixed issue with DownloadTestObserver. The possibility for a hang existed if the download ended up in a different state than the test expected. This fixes that. BUG=117544 TEST=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=126099

Patch Set 1 #

Patch Set 2 : Merged with trunk #

Total comments: 6

Patch Set 3 : Added check that download finished in expected state. #

Total comments: 9

Patch Set 4 : Comment changes per Randy's suggestions. #

Patch Set 5 : Split DownloadTestObserver in two #

Total comments: 15

Patch Set 6 : Merged with trunk. #

Patch Set 7 : Changes per Randy's comments. #

Patch Set 8 : Fixed CLANG issue. #

Total comments: 4

Patch Set 9 : Split DownloadTestObserver further. #

Total comments: 29

Patch Set 10 : More changes per Randy's comments. #

Patch Set 11 : Fixed indentation. #

Patch Set 12 : Merged with parent. #

Patch Set 13 : Fixed GCC compiler issues. #

Patch Set 14 : Changes per Randy's request. #

Patch Set 15 : Fixed initialization order. #

Total comments: 2

Patch Set 16 : Changed DCHECKs to EXPECTs. #

Total comments: 5

Patch Set 17 : Merged with trunk. #

Patch Set 18 : Fixed comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+256 lines, -85 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 22 chunks +87 lines, -45 lines 0 comments Download
M chrome/browser/download/download_extension_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +17 lines, -8 lines 0 comments Download
M chrome/browser/download/download_test_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +73 lines, -15 lines 0 comments Download
M chrome/browser/download/download_test_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +73 lines, -12 lines 0 comments Download
M chrome/browser/ui/browser_close_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -5 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
ahendrickson
8 years, 9 months ago (2012-03-01 14:14:00 UTC) #1
Randy Smith (Not in Mondays)
Ben, could you take a look at this as well? Specifically think about the interface ...
8 years, 9 months ago (2012-03-01 16:48:41 UTC) #2
benjhayden
http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h File chrome/browser/download/download_test_observer.h (right): http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h#newcode98 chrome/browser/download/download_test_observer.h:98: DownloadSet previously_finished_downloads_; So now we have 4 DownloadSets. It ...
8 years, 9 months ago (2012-03-01 19:58:32 UTC) #3
ahendrickson
http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h File chrome/browser/download/download_test_observer.h (right): http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h#newcode88 chrome/browser/download/download_test_observer.h:88: // Should never be called normally, only when there's ...
8 years, 9 months ago (2012-03-01 20:20:14 UTC) #4
ahendrickson
http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h File chrome/browser/download/download_test_observer.h (right): http://codereview.chromium.org/9568003/diff/3001/chrome/browser/download/download_test_observer.h#newcode88 chrome/browser/download/download_test_observer.h:88: // Should never be called normally, only when there's ...
8 years, 9 months ago (2012-03-01 20:38:39 UTC) #5
Randy Smith (Not in Mondays)
So this feels uncomfortable to me; it's making an interface complicated and somewhat unclear. Before ...
8 years, 9 months ago (2012-03-01 21:07:53 UTC) #6
ahendrickson
http://codereview.chromium.org/9568003/diff/4003/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/4003/chrome/browser/download/download_test_observer.cc#newcode57 chrome/browser/download/download_test_observer.cc:57: finished_downloads_at_construction_ = finished_downloads_.size(); On 2012/03/01 21:07:53, rdsmith wrote: > ...
8 years, 9 months ago (2012-03-02 17:29:41 UTC) #7
ahendrickson
PTAL.
8 years, 9 months ago (2012-03-02 19:26:03 UTC) #8
benjhayden
lgtm
8 years, 9 months ago (2012-03-02 20:09:34 UTC) #9
cbentzel
Is there a bug associated with this? There should be which describes the problem.
8 years, 9 months ago (2012-03-02 20:27:19 UTC) #10
ahendrickson
On 2012/03/02 20:27:19, cbentzel wrote: > Is there a bug associated with this? There should ...
8 years, 9 months ago (2012-03-02 21:52:45 UTC) #11
ahendrickson
Split DownloadObserverTest into two classes. The original remains the same, except that it only tests ...
8 years, 9 months ago (2012-03-06 20:22:03 UTC) #12
Randy Smith (Not in Mondays)
http://codereview.chromium.org/9568003/diff/17001/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/17001/chrome/browser/download/download_test_observer.cc#newcode77 chrome/browser/download/download_test_observer.cc:77: if (finished_download_count >= wait_count_) Why the change? It looks ...
8 years, 9 months ago (2012-03-06 21:49:58 UTC) #13
ahendrickson
http://codereview.chromium.org/9568003/diff/17001/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/17001/chrome/browser/download/download_test_observer.cc#newcode77 chrome/browser/download/download_test_observer.cc:77: if (finished_download_count >= wait_count_) On 2012/03/06 21:49:58, rdsmith wrote: ...
8 years, 9 months ago (2012-03-07 15:38:58 UTC) #14
Randy Smith (Not in Mondays)
http://codereview.chromium.org/9568003/diff/25001/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/25001/chrome/browser/download/download_browsertest.cc#newcode695 chrome/browser/download/download_browsertest.cc:695: 1, Shouldn't all the observers where the state has ...
8 years, 9 months ago (2012-03-07 21:39:16 UTC) #15
ahendrickson
http://codereview.chromium.org/9568003/diff/25001/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/25001/chrome/browser/download/download_browsertest.cc#newcode695 chrome/browser/download/download_browsertest.cc:695: 1, On 2012/03/07 21:39:16, rdsmith wrote: > Shouldn't all ...
8 years, 9 months ago (2012-03-08 17:36:06 UTC) #16
Randy Smith (Not in Mondays)
This looks basically good--thanks very much for going along with my class relationship preference. Several ...
8 years, 9 months ago (2012-03-08 18:25:31 UTC) #17
benjhayden
Still catching up on reading the thread of comments. Here's an idea. If it's too ...
8 years, 9 months ago (2012-03-08 20:30:02 UTC) #18
ahendrickson
http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_browsertest.cc#newcode466 chrome/browser/download/download_browsertest.cc:466: DCHECK_EQ(1u, observer->NumDownloadsSeenInState(DownloadItem::COMPLETE)); On 2012/03/08 18:25:31, rdsmith wrote: > I ...
8 years, 9 months ago (2012-03-08 20:56:34 UTC) #19
ahendrickson
On 2012/03/08 20:30:02, benjhayden_chromium wrote: > Still catching up on reading the thread of comments. ...
8 years, 9 months ago (2012-03-08 21:10:38 UTC) #20
ahendrickson
http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_browsertest.cc File chrome/browser/download/download_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_browsertest.cc#newcode405 chrome/browser/download/download_browsertest.cc:405: int num_downloads) { On 2012/03/08 20:30:02, benjhayden_chromium wrote: > ...
8 years, 9 months ago (2012-03-08 21:28:55 UTC) #21
Randy Smith (Not in Mondays)
On 2012/03/08 20:30:02, benjhayden_chromium wrote: > Still catching up on reading the thread of comments. ...
8 years, 9 months ago (2012-03-08 22:13:26 UTC) #22
benjhayden
On 2012/03/08 22:13:26, rdsmith wrote: > On 2012/03/08 20:30:02, benjhayden_chromium wrote: > > Still catching ...
8 years, 9 months ago (2012-03-08 22:28:50 UTC) #23
Randy Smith (Not in Mondays)
On 2012/03/08 22:28:50, benjhayden_chromium wrote: > On 2012/03/08 22:13:26, rdsmith wrote: > > On 2012/03/08 ...
8 years, 9 months ago (2012-03-08 22:34:18 UTC) #24
Randy Smith (Not in Mondays)
http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_test_observer.cc#newcode219 chrome/browser/download/download_test_observer.cc:219: states_observed_.clear(); On 2012/03/08 20:56:34, ahendrickson wrote: > On 2012/03/08 ...
8 years, 9 months ago (2012-03-09 18:39:38 UTC) #25
ahendrickson
http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/31001/chrome/browser/download/download_test_observer.cc#newcode219 chrome/browser/download/download_test_observer.cc:219: states_observed_.clear(); On 2012/03/09 18:39:38, rdsmith wrote: > On 2012/03/08 ...
8 years, 9 months ago (2012-03-09 20:07:23 UTC) #26
ahendrickson
sky: PTAL at chrome/browser/ui/browser_close_browsertest.cc
8 years, 9 months ago (2012-03-09 20:16:19 UTC) #27
sky
http://codereview.chromium.org/9568003/diff/47003/chrome/browser/ui/browser_close_browsertest.cc File chrome/browser/ui/browser_close_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/47003/chrome/browser/ui/browser_close_browsertest.cc#newcode131 chrome/browser/ui/browser_close_browsertest.cc:131: DCHECK_EQ(count_downloads, Why are you using DCHECK in a test?
8 years, 9 months ago (2012-03-09 20:20:28 UTC) #28
ahendrickson
http://codereview.chromium.org/9568003/diff/47003/chrome/browser/ui/browser_close_browsertest.cc File chrome/browser/ui/browser_close_browsertest.cc (right): http://codereview.chromium.org/9568003/diff/47003/chrome/browser/ui/browser_close_browsertest.cc#newcode131 chrome/browser/ui/browser_close_browsertest.cc:131: DCHECK_EQ(count_downloads, On 2012/03/09 20:20:28, sky wrote: > Why are ...
8 years, 9 months ago (2012-03-09 20:49:14 UTC) #29
sky
LGTM
8 years, 9 months ago (2012-03-09 21:01:07 UTC) #30
Randy Smith (Not in Mondays)
LGTM with comment changes below. http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/download_test_observer.cc#newcode223 chrome/browser/download/download_test_observer.cc:223: // You can't override ...
8 years, 9 months ago (2012-03-12 01:52:15 UTC) #31
ahendrickson
http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/download_test_observer.cc File chrome/browser/download/download_test_observer.cc (right): http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/download_test_observer.cc#newcode223 chrome/browser/download/download_test_observer.cc:223: // You can't override virtual functions in a base ...
8 years, 9 months ago (2012-03-12 03:13:54 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ahendrickson@chromium.org/9568003/51011
8 years, 9 months ago (2012-03-12 03:13:59 UTC) #33
commit-bot: I haz the power
Change committed as 126099
8 years, 9 months ago (2012-03-12 04:46:31 UTC) #34
Randy Smith (Not in Mondays)
8 years, 9 months ago (2012-03-12 13:35:55 UTC) #35
http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/dow...
File chrome/browser/download/download_test_observer.h (right):

http://codereview.chromium.org/9568003/diff/49004/chrome/browser/download/dow...
chrome/browser/download/download_test_observer.h:171: // IN_PROGRESS state, or a
Select File Dialog has appeared.
On 2012/03/12 03:13:54, ahendrickson wrote:
> On 2012/03/12 01:52:15, rdsmith wrote:
> > This comment about the select file dialog is no longer correct, correct?
> 
> It is; I added a parameter to the constructor that allows it to finish if the
> select file dialog has appeared.

Um ... that was my point.  This says that the observer finishes when the select
file dialog has appeared, but whether it has that behavior or not depends on the
parameter, so the comment is incorrect.  Am I confused?

Powered by Google App Engine
This is Rietveld 408576698