New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 672581 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add ThrottlingResourceHandler unittests

Project Member Reported by mmenke@chromium.org, Dec 8 2016

Issue description

We should have some ThrottlingResourceHandler unittests (There currently aren't any).  In particular, check the following:

Sync/async resume/cancel at each phase.  Out of band deletion from a ResourceThrottle between each phase.  Maybe out of band cancellation from one throttle when waiting on another?  Don't think we need to test more general out--of-band cancellation, since that will be handled by the ResourceLoader in the new world, via sync destruction.
 
Cc: rdsmith@chromium.org
Components: Internals>Network
Cc: csharrison@chromium.org
It would be great if a test harness for these tests could be used for ResourceThrottle unit tests as well.
I am thinking I'll make a harness for ResourceLoaders in general (Mainly so we can just update the harness to work with the new API, and all the tests will still work, possibly with just string/method name substitutions).  It probably wouldn't get us much over just using the old ResourceHandler API directly, though.
ResourceHandlers, rather.
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91

commit b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91
Author: mmenke <mmenke@chromium.org>
Date: Wed Jan 11 23:10:18 2017

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}

[add] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/browser/loader/mock_resource_loader.cc
[add] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/browser/loader/mock_resource_loader.h
[modify] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/browser/loader/throttling_resource_handler.cc
[modify] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/browser/loader/throttling_resource_handler.h
[add] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/browser/loader/throttling_resource_handler_unittest.cc
[modify] https://crrev.com/b4836c494c0ce6a8c5cf285736efc7cf1ae5fc91/content/test/BUILD.gn

Comment 6 by mmenke@chromium.org, Jan 12 2017

Status: Fixed (was: Assigned)

Sign in to add a comment