| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 ~SocketClient() { | 60 ~SocketClient() { |
| 61 delete socket_; | 61 delete socket_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 SocketAddress address() const { return socket_->GetLocalAddress(); } | 64 SocketAddress address() const { return socket_->GetLocalAddress(); } |
| 65 | 65 |
| 66 void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t size, | 66 void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t size, |
| 67 const SocketAddress& remote_addr, | 67 const SocketAddress& remote_addr, |
| 68 const PacketTime& packet_time) { | 68 const PacketTime& packet_time) { |
| 69 EXPECT_EQ(size, sizeof(uint32)); | 69 EXPECT_EQ(size, sizeof(uint32_t)); |
| 70 uint32 prev = reinterpret_cast<const uint32*>(buf)[0]; | 70 uint32_t prev = reinterpret_cast<const uint32_t*>(buf)[0]; |
| 71 uint32 result = Next(prev); | 71 uint32_t result = Next(prev); |
| 72 | 72 |
| 73 post_thread_->PostDelayed(200, post_handler_, 0, new TestMessage(result)); | 73 post_thread_->PostDelayed(200, post_handler_, 0, new TestMessage(result)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 AsyncUDPSocket* socket_; | 77 AsyncUDPSocket* socket_; |
| 78 Thread* post_thread_; | 78 Thread* post_thread_; |
| 79 MessageHandler* post_handler_; | 79 MessageHandler* post_handler_; |
| 80 }; | 80 }; |
| 81 | 81 |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 }; | 713 }; |
| 714 | 714 |
| 715 TEST_F(ComThreadTest, ComInited) { | 715 TEST_F(ComThreadTest, ComInited) { |
| 716 Thread* thread = new ComThread(); | 716 Thread* thread = new ComThread(); |
| 717 EXPECT_TRUE(thread->Start()); | 717 EXPECT_TRUE(thread->Start()); |
| 718 thread->Post(this, 0); | 718 thread->Post(this, 0); |
| 719 EXPECT_TRUE_WAIT(done_, 1000); | 719 EXPECT_TRUE_WAIT(done_, 1000); |
| 720 delete thread; | 720 delete thread; |
| 721 } | 721 } |
| 722 #endif | 722 #endif |
| OLD | NEW |