| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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/system_wrappers/interface/logging.h" | 11 #include "webrtc/system_wrappers/include/logging.h" |
| 12 | 12 |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
| 15 #include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" | 15 #include "webrtc/system_wrappers/include/condition_variable_wrapper.h" |
| 16 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 16 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
| 17 #include "webrtc/system_wrappers/interface/sleep.h" | 17 #include "webrtc/system_wrappers/include/sleep.h" |
| 18 #include "webrtc/system_wrappers/interface/trace.h" | 18 #include "webrtc/system_wrappers/include/trace.h" |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 class LoggingTest : public ::testing::Test, public TraceCallback { | 23 class LoggingTest : public ::testing::Test, public TraceCallback { |
| 24 public: | 24 public: |
| 25 virtual void Print(TraceLevel level, const char* msg, int length) { | 25 virtual void Print(TraceLevel level, const char* msg, int length) { |
| 26 CriticalSectionScoped cs(crit_.get()); | 26 CriticalSectionScoped cs(crit_.get()); |
| 27 // We test the length here to ensure (with high likelihood) that only our | 27 // We test the length here to ensure (with high likelihood) that only our |
| 28 // traces will be tested. | 28 // traces will be tested. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 level_ = kTraceError; | 80 level_ = kTraceError; |
| 81 expected_log_ << "(logging_unittest.cc:" << __LINE__ + 2 | 81 expected_log_ << "(logging_unittest.cc:" << __LINE__ + 2 |
| 82 << "): Foo failed: bar=" << bar << ", baz=" << baz; | 82 << "): Foo failed: bar=" << bar << ", baz=" << baz; |
| 83 LOG_FERR2(LS_ERROR, Foo, bar, baz); | 83 LOG_FERR2(LS_ERROR, Foo, bar, baz); |
| 84 cv_->SleepCS(*crit_.get(), 2000); | 84 cv_->SleepCS(*crit_.get(), 2000); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 } // namespace webrtc | 89 } // namespace webrtc |
| OLD | NEW |