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

Issue 147117: Make more things possible with mock sockets:... (Closed)

Created:
11 years, 6 months ago by Paweł Hajdan Jr.
Modified:
9 years, 7 months ago
Reviewers:
eroman, wtc
CC:
chromium-reviews_googlegroups.com, darin (slow to review), willchan no longer on Chromium
Visibility:
Public.

Description

Make more things possible with mock sockets: - check connection state in mock read and write - make possible simulating short reads in DynamicMockSocket TEST=none http://crbug.com/15259 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=19222

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -25 lines) Patch
M net/socket/socket_test_util.h View 1 4 chunks +10 lines, -9 lines 0 comments Download
M net/socket/socket_test_util.cc View 7 chunks +31 lines, -16 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Paweł Hajdan Jr.
11 years, 6 months ago (2009-06-24 23:46:39 UTC) #1
wtc
LGTM. http://codereview.chromium.org/147117/diff/1/2 File net/socket/socket_test_util.cc (right): http://codereview.chromium.org/147117/diff/1/2#newcode308 Line 308: MockRead StaticMockSocket::GetNextRead() { This will return a ...
11 years, 6 months ago (2009-06-25 00:21:55 UTC) #2
eroman
lgtm
11 years, 6 months ago (2009-06-25 01:21:04 UTC) #3
Paweł Hajdan Jr.
11 years, 6 months ago (2009-06-25 02:43:28 UTC) #4
> http://codereview.chromium.org/147117/diff/1/2#newcode308
> Line 308: MockRead StaticMockSocket::GetNextRead() {
> This will return a copy of MockRead.  Is that intentional?

Yes. This way it's easier to implement mocking short reads. I can return a copy
of MockRead and modify the stored copy.

> http://codereview.chromium.org/147117/diff/1/3
> File net/socket/socket_test_util.h (right):
> 
> http://codereview.chromium.org/147117/diff/1/3#newcode70
> Line 70: MockSocket() {
> Nit: put {} on the same line, to be consistent with the
> destructor below.

Done.

> http://codereview.chromium.org/147117/diff/1/3#newcode135
> Line 135: // Max number of bytes we will return to be read at a time. 0 means
no
> limit.
> Nit: "return to be read" => "return from Read" or just "read"

Done.

Powered by Google App Engine
This is Rietveld 408576698