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

Issue 2881001: Cleaning up SPDY unit tests (Closed)

Created:
10 years, 6 months ago by Matthew Lloyd
Modified:
9 years, 7 months ago
Reviewers:
Mike Belshe
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., cbentzel
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Refactors SPDY frame construction methods out of spdy_network_transaction_unittest.cc to promote code reuse. Removes the kGetSyn and kGetSynReply binary SPDY frame constants and replaces them with calls to factory methods, for better clarity and to reduce maintenance costs going forward. Also adds some helper methods for constructing mock reads and writes from SpdyFrames. TEST=net_unittests pass. BUG=None Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=51049

Patch Set 1 #

Total comments: 14

Patch Set 2 : Review responses #

Patch Set 3 : Added spdy_test_util.cc to net.gyp #

Patch Set 4 : Undo mode changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+602 lines, -504 lines) Patch
M net/http/http_network_transaction_unittest.cc View 1 2 4 chunks +14 lines, -20 lines 0 comments Download
M net/net.gyp View 3 1 chunk +1 line, -0 lines 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 1 2 3 37 chunks +88 lines, -453 lines 0 comments Download
M net/spdy/spdy_test_util.h View 1 2 3 2 chunks +132 lines, -31 lines 0 comments Download
A net/spdy/spdy_test_util.cc View 1 1 chunk +367 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Matthew Lloyd
10 years, 6 months ago (2010-06-25 20:10:53 UTC) #1
Mike Belshe
All nits - lgtm http://codereview.chromium.org/2881001/diff/1/4 File net/spdy/spdy_test_util.cc (right): http://codereview.chromium.org/2881001/diff/1/4#newcode10 net/spdy/spdy_test_util.cc:10: #include "net/base/completion_callback.h" nit: don't need ...
10 years, 6 months ago (2010-06-25 20:26:40 UTC) #2
Matthew Lloyd
10 years, 6 months ago (2010-06-25 20:43:49 UTC) #3
Thanks for the prompt review. All done.

http://codereview.chromium.org/2881001/diff/1/4
File net/spdy/spdy_test_util.cc (right):

http://codereview.chromium.org/2881001/diff/1/4#newcode10
net/spdy/spdy_test_util.cc:10: #include "net/base/completion_callback.h"
On 2010/06/25 20:26:40, Mike Belshe wrote:
> nit: don't need this?  can you take a pass through and prune out the
unnecessary
> includes?

Done.

http://codereview.chromium.org/2881001/diff/1/4#newcode133
net/spdy/spdy_test_util.cc:133: // Returns a SpdFrame.
On 2010/06/25 20:26:40, Mike Belshe wrote:
> typo

Done.

http://codereview.chromium.org/2881001/diff/1/5
File net/spdy/spdy_test_util.h (right):

http://codereview.chromium.org/2881001/diff/1/5#newcode89
net/spdy/spdy_test_util.h:89: int kind;
On 2010/06/25 20:26:40, Mike Belshe wrote:
> nit:  while you're here could you document a few of these?  I can never
remember
> what "kind" is without looking deeper :-)
> 
> Maybe this is supposed to be a SpdyControlType ?

Even better - I changed the types to the appropriate enums.

http://codereview.chromium.org/2881001/diff/1/5#newcode126
net/spdy/spdy_test_util.h:126: int AppendToBuffer(const void* str,
On 2010/06/25 20:26:40, Mike Belshe wrote:
> nit:  can we use a const char* here? 

Done.

http://codereview.chromium.org/2881001/diff/1/5#newcode130
net/spdy/spdy_test_util.h:130: if (len <= 0)
On 2010/06/25 20:26:40, Mike Belshe wrote:
> nit: DCHECK_GE(len, 0);

Done.

http://codereview.chromium.org/2881001/diff/1/5#newcode159
net/spdy/spdy_test_util.h:159: // Returns a SpdFrame.
On 2010/06/25 20:26:40, Mike Belshe wrote:
> typo: SpdyFrame

Done.

http://codereview.chromium.org/2881001/diff/1/5#newcode206
net/spdy/spdy_test_util.h:206: // Create a MockWrite from the given SpdyFrame.
On 2010/06/25 20:26:40, Mike Belshe wrote:
> nit:  "Create an async MockWrite..."

Done.

Powered by Google App Engine
This is Rietveld 408576698