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 // The following include must be first in this file. It ensures that | 10 // The following include must be first in this file. It ensures that |
11 // libjingle style logging is used. | 11 // libjingle style logging is used. |
12 #define LOGGING_INSIDE_WEBRTC | 12 #define LOGGING_INSIDE_WEBRTC |
13 | 13 |
14 #include "third_party/webrtc/overrides/webrtc/base/logging.h" | 14 #include "third_party/webrtc/overrides/webrtc/base/logging.h" |
15 | 15 |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 static const wchar_t* const log_file_name = L"libjingle_logging.log"; | 21 static const wchar_t* const log_file_name = L"libjingle_logging.log"; |
22 #else | 22 #else |
23 static const char* const log_file_name = "libjingle_logging.log"; | 23 static const char* const log_file_name = "libjingle_logging.log"; |
24 #endif | 24 #endif |
25 | 25 |
26 static const int kDefaultVerbosity = 0; | 26 static const int kDefaultVerbosity = 0; |
27 | 27 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 EXPECT_TRUE(ContainsString(contents_of_file, | 152 EXPECT_TRUE(ContainsString(contents_of_file, |
153 AsString(rtc::LS_WARNING))); | 153 AsString(rtc::LS_WARNING))); |
154 EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); | 154 EXPECT_TRUE(ContainsString(contents_of_file, AsString(rtc::LS_INFO))); |
155 // LOG_E | 155 // LOG_E |
156 EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); | 156 EXPECT_TRUE(ContainsString(contents_of_file, strerror(kFakeError))); |
157 EXPECT_TRUE(ContainsString(contents_of_file, | 157 EXPECT_TRUE(ContainsString(contents_of_file, |
158 AsString(rtc::LS_VERBOSE))); | 158 AsString(rtc::LS_VERBOSE))); |
159 EXPECT_TRUE(ContainsString(contents_of_file, | 159 EXPECT_TRUE(ContainsString(contents_of_file, |
160 AsString(rtc::LS_SENSITIVE))); | 160 AsString(rtc::LS_SENSITIVE))); |
161 } | 161 } |
OLD | NEW |