| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 14 matching lines...) Expand all Loading... |
| 25 void Run() { | 25 void Run() { |
| 26 ss_->WakeUp(); | 26 ss_->WakeUp(); |
| 27 } | 27 } |
| 28 private: | 28 private: |
| 29 SocketServer* ss_; | 29 SocketServer* ss_; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // Test that MacCocoaSocketServer::Wait works as expected. | 32 // Test that MacCocoaSocketServer::Wait works as expected. |
| 33 TEST(MacCocoaSocketServer, TestWait) { | 33 TEST(MacCocoaSocketServer, TestWait) { |
| 34 MacCocoaSocketServer server; | 34 MacCocoaSocketServer server; |
| 35 uint32 start = Time(); | 35 uint32_t start = Time(); |
| 36 server.Wait(1000, true); | 36 server.Wait(1000, true); |
| 37 EXPECT_GE(TimeSince(start), 1000); | 37 EXPECT_GE(TimeSince(start), 1000); |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Test that MacCocoaSocketServer::Wakeup works as expected. | 40 // Test that MacCocoaSocketServer::Wakeup works as expected. |
| 41 TEST(MacCocoaSocketServer, TestWakeup) { | 41 TEST(MacCocoaSocketServer, TestWakeup) { |
| 42 MacCFSocketServer server; | 42 MacCFSocketServer server; |
| 43 WakeThread thread(&server); | 43 WakeThread thread(&server); |
| 44 uint32 start = Time(); | 44 uint32_t start = Time(); |
| 45 thread.Start(); | 45 thread.Start(); |
| 46 server.Wait(10000, true); | 46 server.Wait(10000, true); |
| 47 EXPECT_LT(TimeSince(start), 10000); | 47 EXPECT_LT(TimeSince(start), 10000); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace rtc | 50 } // namespace rtc |
| OLD | NEW |