OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2007 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 char buf[1024] = {0}; | 662 char buf[1024] = {0}; |
663 | 663 |
664 EXPECT_EQ(1024, client->Send(buf, 1024)); | 664 EXPECT_EQ(1024, client->Send(buf, 1024)); |
665 EXPECT_FALSE(sink.Check(accepted.get(), testing::SSE_READ)); | 665 EXPECT_FALSE(sink.Check(accepted.get(), testing::SSE_READ)); |
666 | 666 |
667 // Shouldn't signal when blocked in a thread Send, where process_io is false. | 667 // Shouldn't signal when blocked in a thread Send, where process_io is false. |
668 std::unique_ptr<Thread> thread(new Thread()); | 668 std::unique_ptr<Thread> thread(new Thread()); |
669 thread->Start(); | 669 thread->Start(); |
670 Sleeper sleeper; | 670 Sleeper sleeper; |
671 TypedMessageData<AsyncSocket*> data(client.get()); | 671 TypedMessageData<AsyncSocket*> data(client.get()); |
672 thread->Send(&sleeper, 0, &data); | 672 thread->Send(FROM_HERE, &sleeper, 0, &data); |
673 EXPECT_FALSE(sink.Check(accepted.get(), testing::SSE_READ)); | 673 EXPECT_FALSE(sink.Check(accepted.get(), testing::SSE_READ)); |
674 | 674 |
675 // But should signal when process_io is true. | 675 // But should signal when process_io is true. |
676 EXPECT_TRUE_WAIT((sink.Check(accepted.get(), testing::SSE_READ)), kTimeout); | 676 EXPECT_TRUE_WAIT((sink.Check(accepted.get(), testing::SSE_READ)), kTimeout); |
677 EXPECT_LT(0, accepted->Recv(buf, 1024)); | 677 EXPECT_LT(0, accepted->Recv(buf, 1024)); |
678 } | 678 } |
679 | 679 |
680 void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size, | 680 void SocketTest::TcpInternal(const IPAddress& loopback, size_t data_size, |
681 ssize_t max_send_size) { | 681 ssize_t max_send_size) { |
682 testing::StreamSink sink; | 682 testing::StreamSink sink; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 ASSERT_EQ(-1, mtu_socket->EstimateMTU(&mtu)); | 1018 ASSERT_EQ(-1, mtu_socket->EstimateMTU(&mtu)); |
1019 #else | 1019 #else |
1020 // and the behavior seems unpredictable on Linux, | 1020 // and the behavior seems unpredictable on Linux, |
1021 // failing on the build machine | 1021 // failing on the build machine |
1022 // but succeeding on my Ubiquity instance. | 1022 // but succeeding on my Ubiquity instance. |
1023 #endif | 1023 #endif |
1024 } | 1024 } |
1025 } | 1025 } |
1026 | 1026 |
1027 } // namespace rtc | 1027 } // namespace rtc |
OLD | NEW |