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

Issue 2563163002: Add some tests for ThrottlingResourceHandler. (Closed)

Created:
4 years ago by mmenke
Modified:
3 years, 11 months ago
CC:
chromium-reviews, loading-reviews_chromium.org, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add some tests for ThrottlingResourceHandler. Also introduce a new wrapper class for testing ResourceHandlers, which will be useful to help make an upcoming API chance a bit simpler. Also add support for on ResourceThrottle calling Resume() after another does an out-of-band-cancel. We have nothing to prevent that case, but a DCHECK could be triggered in the (unlikely) case it happened. BUG=672581 Review-Url: https://codereview.chromium.org/2563163002 Cr-Commit-Position: refs/heads/master@{#443043} Committed: https://chromium.googlesource.com/chromium/src/+/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91

Patch Set 1 #

Patch Set 2 : More tests.... #

Patch Set 3 : Another test #

Patch Set 4 : Placate clang, add test, update comments #

Patch Set 5 : net_error -> error_code, to match ResourceController API #

Patch Set 6 : Merge #

Total comments: 18

Patch Set 7 : Response to comments #

Patch Set 8 : Merge (Trivial merge conflict in includes) #

Patch Set 9 : Fix merge #

Patch Set 10 : Fix leaks #

Total comments: 5

Patch Set 11 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1188 lines, -4 lines) Patch
A content/browser/loader/mock_resource_loader.h View 1 2 3 4 5 6 7 8 9 1 chunk +85 lines, -0 lines 0 comments Download
A content/browser/loader/mock_resource_loader.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +188 lines, -0 lines 0 comments Download
M content/browser/loader/throttling_resource_handler.h View 1 2 3 4 5 6 7 3 chunks +7 lines, -2 lines 0 comments Download
M content/browser/loader/throttling_resource_handler.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -2 lines 0 comments Download
A content/browser/loader/throttling_resource_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +899 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (38 generated)
mmenke
The test file is large, but the tests are mostly unexciting expects. The new tests ...
4 years ago (2016-12-15 22:08:16 UTC) #4
Randy Smith (Not in Mondays)
This looks good to me except for the change of the DCHECK to a conditional ...
4 years ago (2016-12-20 22:16:42 UTC) #20
mmenke
Finally have time to get back to this stuff. https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc File content/browser/loader/throttling_resource_handler.cc (right): https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc#newcode128 content/browser/loader/throttling_resource_handler.cc:128: ...
3 years, 11 months ago (2017-01-04 22:02:29 UTC) #23
mmenke
https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc File content/browser/loader/throttling_resource_handler.cc (right): https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc#newcode128 content/browser/loader/throttling_resource_handler.cc:128: // currently active throttle called Cancel() or if it ...
3 years, 11 months ago (2017-01-05 18:50:00 UTC) #37
mmenke
Friendly ping! (For the MojoAsyncResourceHandler tests, too. Feel free to put off the big one). ...
3 years, 11 months ago (2017-01-06 20:40:07 UTC) #40
Randy Smith (Not in Mondays)
On 2017/01/06 20:40:07, mmenke wrote: > Friendly ping! (For the MojoAsyncResourceHandler tests, too. Feel free ...
3 years, 11 months ago (2017-01-10 23:08:29 UTC) #41
mmenke
On 2017/01/10 23:08:29, Randy Smith - Not in Mondays wrote: > On 2017/01/06 20:40:07, mmenke ...
3 years, 11 months ago (2017-01-10 23:37:26 UTC) #42
Randy Smith (Not in Mondays)
Only remaining concern is the use-after-free comment below. https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc File content/browser/loader/throttling_resource_handler.cc (right): https://codereview.chromium.org/2563163002/diff/100001/content/browser/loader/throttling_resource_handler.cc#newcode128 content/browser/loader/throttling_resource_handler.cc:128: // ...
3 years, 11 months ago (2017-01-11 19:57:15 UTC) #43
mmenke
https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc File content/browser/loader/mock_resource_loader.cc (right): https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc#newcode55 content/browser/loader/mock_resource_loader.cc:55: response.get(), &defer); On 2017/01/11 19:57:15, Randy Smith - Not ...
3 years, 11 months ago (2017-01-11 20:39:14 UTC) #44
mmenke
On 2017/01/11 20:39:14, mmenke wrote: > https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc > File content/browser/loader/mock_resource_loader.cc (right): > > https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc#newcode55 > ...
3 years, 11 months ago (2017-01-11 20:49:25 UTC) #45
Randy Smith (Not in Mondays)
Ah, thanks! LGTM. (You can decide whether and when to act on my comment below.) ...
3 years, 11 months ago (2017-01-11 21:11:02 UTC) #46
mmenke
Thanks for the review! https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc File content/browser/loader/mock_resource_loader.cc (right): https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc#newcode55 content/browser/loader/mock_resource_loader.cc:55: response.get(), &defer); On 2017/01/11 21:11:02, ...
3 years, 11 months ago (2017-01-11 21:16:37 UTC) #47
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/2563163002/220001
3 years, 11 months ago (2017-01-11 21:17:25 UTC) #49
Randy Smith (Not in Mondays)
https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc File content/browser/loader/mock_resource_loader.cc (right): https://codereview.chromium.org/2563163002/diff/200001/content/browser/loader/mock_resource_loader.cc#newcode55 content/browser/loader/mock_resource_loader.cc:55: response.get(), &defer); On 2017/01/11 21:16:37, mmenke wrote: > On ...
3 years, 11 months ago (2017-01-11 21:35:54 UTC) #50
commit-bot: I haz the power
3 years, 11 months ago (2017-01-11 23:11:03 UTC) #53
Message was sent while issue was closed.
Committed patchset #11 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/b4836c494c0ce6a8c5cf285736ef...

Powered by Google App Engine
This is Rietveld 408576698