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

Side by Side Diff: net/socket/socket_test_util.h

Issue 9419032: Modify the MockConnect constructor to take an enum of ASYNC or SYNC, instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Test Break Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <cstring> 9 #include <cstring>
10 #include <deque> 10 #include <deque>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ = -10000, 46 ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ = -10000,
47 }; 47 };
48 48
49 class AsyncSocket; 49 class AsyncSocket;
50 class MockClientSocket; 50 class MockClientSocket;
51 class OriginBoundCertService; 51 class OriginBoundCertService;
52 class SSLClientSocket; 52 class SSLClientSocket;
53 class SSLHostInfo; 53 class SSLHostInfo;
54 class StreamSocket; 54 class StreamSocket;
55 55
56 enum ConnectMode {
57 ASYNC,
58 SYNCHRONOUS
59 };
60
56 struct MockConnect { 61 struct MockConnect {
57 // Asynchronous connection success. 62 // Asynchronous connection success.
58 MockConnect() : async(true), result(OK) { } 63 MockConnect() : async(true), result(OK) { }
59 MockConnect(bool a, int r) : async(a), result(r) { } 64 MockConnect(ConnectMode m, int r) : async(m == ASYNC), result(r) { }
60 65
61 bool async; 66 bool async;
62 int result; 67 int result;
63 }; 68 };
64 69
65 struct MockRead { 70 struct MockRead {
66 // Flag to indicate that the message loop should be terminated. 71 // Flag to indicate that the message loop should be terminated.
67 enum { 72 enum {
68 STOPLOOP = 1 << 31 73 STOPLOOP = 1 << 31
69 }; 74 };
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 1037
1033 extern const char kSOCKS5OkRequest[]; 1038 extern const char kSOCKS5OkRequest[];
1034 extern const int kSOCKS5OkRequestLength; 1039 extern const int kSOCKS5OkRequestLength;
1035 1040
1036 extern const char kSOCKS5OkResponse[]; 1041 extern const char kSOCKS5OkResponse[];
1037 extern const int kSOCKS5OkResponseLength; 1042 extern const int kSOCKS5OkResponseLength;
1038 1043
1039 } // namespace net 1044 } // namespace net
1040 1045
1041 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1046 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698