| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Note: this test tests LOG_V and LOG_E since all other logs are expressed | 5 // Note: this test tests LOG_V and LOG_E since all other logs are expressed |
| 6 // in forms of them. LOG is also tested for good measure. | 6 // in forms of them. LOG is also tested for good measure. |
| 7 // Also note that we are only allowed to call InitLogging() twice so the test | 7 // Also note that we are only allowed to call InitLogging() twice so the test |
| 8 // cases are more dense than normal. | 8 // cases are more dense than normal. |
| 9 | 9 |
| 10 // We must include Chromium headers before including the overrides header | 10 // We must include Chromium headers before including the overrides header |
| 11 // since webrtc's logging.h file may conflict with chromium. | 11 // since webrtc's logging.h file may conflict with chromium. |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 // The following include come before including logging.h. It ensures that | 16 // The following include come before including logging.h. It ensures that |
| 17 // libjingle style logging is used. | 17 // libjingle style logging is used. |
| 18 #define LOGGING_INSIDE_WEBRTC | 18 #define LOGGING_INSIDE_WEBRTC |
| 19 | 19 |
| 20 #include "third_party/webrtc/overrides/webrtc/base/logging.h" | 20 #include "third_party/webrtc_overrides/webrtc/base/logging.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 static const wchar_t* const log_file_name = L"libjingle_logging.log"; | 23 static const wchar_t* const log_file_name = L"libjingle_logging.log"; |
| 24 #else | 24 #else |
| 25 static const char* const log_file_name = "libjingle_logging.log"; | 25 static const char* const log_file_name = "libjingle_logging.log"; |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 static const int kDefaultVerbosity = 0; | 28 static const int kDefaultVerbosity = 0; |
| 29 | 29 |
| 30 static const char* AsString(rtc::LoggingSeverity severity) { | 30 static const char* AsString(rtc::LoggingSeverity severity) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 EXPECT_TRUE(ContainsString(contents_of_file, | 153 EXPECT_TRUE(ContainsString(contents_of_file, |
| 154 AsString(rtc::LS_WARNING))); | 154 AsString(rtc::LS_WARNING))); |
| 155 EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); | 155 EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); |
| 156 // LOG_E | 156 // LOG_E |
| 157 EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); | 157 EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); |
| 158 EXPECT_TRUE(ContainsString(contents_of_file, | 158 EXPECT_TRUE(ContainsString(contents_of_file, |
| 159 AsString(rtc::LS_VERBOSE))); | 159 AsString(rtc::LS_VERBOSE))); |
| 160 EXPECT_TRUE(ContainsString(contents_of_file, | 160 EXPECT_TRUE(ContainsString(contents_of_file, |
| 161 AsString(rtc::LS_SENSITIVE))); | 161 AsString(rtc::LS_SENSITIVE))); |
| 162 } | 162 } |
| OLD | NEW |