| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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/common.h" | 11 #include "webrtc/base/common.h" |
| 12 #include "webrtc/base/gunit.h" | 12 #include "webrtc/base/gunit.h" |
| 13 #include "webrtc/base/messagehandler.h" | 13 #include "webrtc/base/messagehandler.h" |
| 14 #include "webrtc/base/messagequeue.h" | 14 #include "webrtc/base/messagequeue.h" |
| 15 #include "webrtc/base/scoped_ptr.h" | 15 #include "webrtc/base/scoped_ptr.h" |
| 16 #include "webrtc/base/sharedexclusivelock.h" | 16 #include "webrtc/base/sharedexclusivelock.h" |
| 17 #include "webrtc/base/thread.h" | 17 #include "webrtc/base/thread.h" |
| 18 #include "webrtc/base/timeutils.h" | 18 #include "webrtc/base/timeutils.h" |
| 19 #include "webrtc/test/testsupport/gtest_disable.h" | |
| 20 | 19 |
| 21 namespace rtc { | 20 namespace rtc { |
| 22 | 21 |
| 23 static const uint32_t kMsgRead = 0; | 22 static const uint32_t kMsgRead = 0; |
| 24 static const uint32_t kMsgWrite = 0; | 23 static const uint32_t kMsgWrite = 0; |
| 25 static const int kNoWaitThresholdInMs = 10; | 24 static const int kNoWaitThresholdInMs = 10; |
| 26 static const int kWaitThresholdInMs = 80; | 25 static const int kWaitThresholdInMs = 80; |
| 27 static const int kProcessTimeInMs = 100; | 26 static const int kProcessTimeInMs = 100; |
| 28 static const int kProcessTimeoutInMs = 5000; | 27 static const int kProcessTimeoutInMs = 5000; |
| 29 | 28 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 Thread::SleepMs(kProcessTimeInMs); | 209 Thread::SleepMs(kProcessTimeInMs); |
| 211 EXPECT_EQ(1, value_); | 210 EXPECT_EQ(1, value_); |
| 212 } | 211 } |
| 213 | 212 |
| 214 EXPECT_TRUE_WAIT(done, kProcessTimeoutInMs); | 213 EXPECT_TRUE_WAIT(done, kProcessTimeoutInMs); |
| 215 EXPECT_EQ(2, value_); | 214 EXPECT_EQ(2, value_); |
| 216 EXPECT_GE(writer.waiting_time_in_ms(), kWaitThresholdInMs); | 215 EXPECT_GE(writer.waiting_time_in_ms(), kWaitThresholdInMs); |
| 217 } | 216 } |
| 218 | 217 |
| 219 } // namespace rtc | 218 } // namespace rtc |
| OLD | NEW |