| 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 |
| 11 #include "webrtc/base/gunit.h" | 11 #include "webrtc/base/gunit.h" |
| 12 #include "webrtc/base/scoped_ptr.h" | |
| 13 #include "webrtc/base/thread.h" | 12 #include "webrtc/base/thread.h" |
| 14 #include "webrtc/base/maccocoasocketserver.h" | 13 #include "webrtc/base/maccocoasocketserver.h" |
| 15 | 14 |
| 16 namespace rtc { | 15 namespace rtc { |
| 17 | 16 |
| 18 class WakeThread : public Thread { | 17 class WakeThread : public Thread { |
| 19 public: | 18 public: |
| 20 WakeThread(SocketServer* ss) : ss_(ss) { | 19 WakeThread(SocketServer* ss) : ss_(ss) { |
| 21 } | 20 } |
| 22 virtual ~WakeThread() { | 21 virtual ~WakeThread() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 TEST(MacCocoaSocketServer, TestWakeup) { | 40 TEST(MacCocoaSocketServer, TestWakeup) { |
| 42 MacCFSocketServer server; | 41 MacCFSocketServer server; |
| 43 WakeThread thread(&server); | 42 WakeThread thread(&server); |
| 44 uint32_t start = Time(); | 43 uint32_t start = Time(); |
| 45 thread.Start(); | 44 thread.Start(); |
| 46 server.Wait(10000, true); | 45 server.Wait(10000, true); |
| 47 EXPECT_LT(TimeSince(start), 10000); | 46 EXPECT_LT(TimeSince(start), 10000); |
| 48 } | 47 } |
| 49 | 48 |
| 50 } // namespace rtc | 49 } // namespace rtc |
| OLD | NEW |