OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <poll.h> | 5 #include <poll.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "net/base/net_test_suite.h" | 10 #include "net/base/net_test_suite.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 CurveCPTransferTest() {} | 24 CurveCPTransferTest() {} |
25 }; | 25 }; |
26 | 26 |
27 void RunEchoTest(int bytes) { | 27 void RunEchoTest(int bytes) { |
28 TestServer server; | 28 TestServer server; |
29 TestClient client; | 29 TestClient client; |
30 | 30 |
31 EXPECT_TRUE(server.Start(1234)); | 31 EXPECT_TRUE(server.Start(1234)); |
32 HostPortPair server_address("localhost", 1234); | 32 HostPortPair server_address("localhost", 1234); |
33 TestOldCompletionCallback cb; | 33 TestCompletionCallback cb; |
34 EXPECT_TRUE(client.Start(server_address, bytes, &cb)); | 34 EXPECT_TRUE(client.Start(server_address, bytes, cb.callback())); |
35 | 35 |
36 int rv = cb.WaitForResult(); | 36 int rv = cb.WaitForResult(); |
37 EXPECT_EQ(0, rv); | 37 EXPECT_EQ(0, rv); |
38 EXPECT_EQ(0, server.error_count()); | 38 EXPECT_EQ(0, server.error_count()); |
39 EXPECT_EQ(0, client.error_count()); | 39 EXPECT_EQ(0, client.error_count()); |
40 } | 40 } |
41 | 41 |
42 /* | 42 /* |
43 TEST_F(CurveCPTransferTest, Echo_50B_Of_Data) { | 43 TEST_F(CurveCPTransferTest, Echo_50B_Of_Data) { |
44 RunEchoTest(50); | 44 RunEchoTest(50); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 */ | 305 */ |
306 | 306 |
307 } // namespace net | 307 } // namespace net |
308 | 308 |
309 int main(int argc, char**argv) { | 309 int main(int argc, char**argv) { |
310 base::StatisticsRecorder recorder; | 310 base::StatisticsRecorder recorder; |
311 NetTestSuite test_suite(argc, argv); | 311 NetTestSuite test_suite(argc, argv); |
312 return test_suite.Run(); | 312 return test_suite.Run(); |
313 } | 313 } |
OLD | NEW |