| 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 |
| 11 #include "webrtc/base/messagequeue.h" | 11 #include "webrtc/base/messagequeue.h" |
| 12 | 12 |
| 13 #include "webrtc/base/bind.h" | 13 #include "webrtc/base/bind.h" |
| 14 #include "webrtc/base/gunit.h" | 14 #include "webrtc/base/gunit.h" |
| 15 #include "webrtc/base/logging.h" | 15 #include "webrtc/base/logging.h" |
| 16 #include "webrtc/base/thread.h" | 16 #include "webrtc/base/thread.h" |
| 17 #include "webrtc/base/timeutils.h" | 17 #include "webrtc/base/timeutils.h" |
| 18 #include "webrtc/base/nullsocketserver.h" | 18 #include "webrtc/base/nullsocketserver.h" |
| 19 #include "webrtc/test/testsupport/gtest_disable.h" | |
| 20 | 19 |
| 21 using namespace rtc; | 20 using namespace rtc; |
| 22 | 21 |
| 23 class MessageQueueTest: public testing::Test, public MessageQueue { | 22 class MessageQueueTest: public testing::Test, public MessageQueue { |
| 24 public: | 23 public: |
| 25 bool IsLocked_Worker() { | 24 bool IsLocked_Worker() { |
| 26 if (!crit_.TryEnter()) { | 25 if (!crit_.TryEnter()) { |
| 27 return true; | 26 return true; |
| 28 } | 27 } |
| 29 crit_.Leave(); | 28 crit_.Leave(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 << "MessageQueueManager was already initialized by some " | 131 << "MessageQueueManager was already initialized by some " |
| 133 << "other test in this run."; | 132 << "other test in this run."; |
| 134 return; | 133 return; |
| 135 } | 134 } |
| 136 bool deleted = false; | 135 bool deleted = false; |
| 137 DeletedMessageHandler* handler = new DeletedMessageHandler(&deleted); | 136 DeletedMessageHandler* handler = new DeletedMessageHandler(&deleted); |
| 138 delete handler; | 137 delete handler; |
| 139 EXPECT_TRUE(deleted); | 138 EXPECT_TRUE(deleted); |
| 140 EXPECT_FALSE(MessageQueueManager::IsInitialized()); | 139 EXPECT_FALSE(MessageQueueManager::IsInitialized()); |
| 141 } | 140 } |
| OLD | NEW |