Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc

Issue 1142043005: Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix type conversion errors on win64 for some msvs Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc
diff --git a/third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc b/third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc
index 7aef2ee8aed377644b9153ce222a1a88a26e9c44..8ca5538571c81c05a21e4745d3b52940a36a882a 100644
--- a/third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc
+++ b/third_party/mojo/src/mojo/public/cpp/environment/tests/logger_unittest.cc
@@ -10,22 +10,30 @@ namespace mojo {
namespace {
TEST(LoggerTest, Basic) {
+ const char kPath[] = "/fake/path/to/file.cc";
+
Environment environment;
const MojoLogger* const logger = Environment::GetDefaultLogger();
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, "Logged at VERBOSE-1 level");
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, "Logged at VERBOSE level");
- logger->LogMessage(MOJO_LOG_LEVEL_INFO, "Logged at INFO level");
- logger->LogMessage(MOJO_LOG_LEVEL_WARNING, "Logged at WARNING level");
- logger->LogMessage(MOJO_LOG_LEVEL_ERROR, "Logged at ERROR level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, kPath, 123,
+ "Logged at VERBOSE-1 level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, kPath, 123,
+ "Logged at VERBOSE level");
+ logger->LogMessage(MOJO_LOG_LEVEL_INFO, kPath, 123, "Logged at INFO level");
+ logger->LogMessage(MOJO_LOG_LEVEL_WARNING, kPath, 123,
+ "Logged at WARNING level");
+ logger->LogMessage(MOJO_LOG_LEVEL_ERROR, kPath, 123, "Logged at ERROR level");
// This should kill us:
- EXPECT_DEATH_IF_SUPPORTED(
- { logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level"); },
- "");
+ EXPECT_DEATH_IF_SUPPORTED({
+ logger->LogMessage(MOJO_LOG_LEVEL_FATAL, kPath, 123,
+ "Logged at FATAL level");
+ }, "");
}
TEST(LoggerTest, LogLevels) {
+ const char kPath[] = "/fake/path/to/file.cc";
+
Environment environment;
const MojoLogger* const logger = Environment::GetDefaultLogger();
@@ -39,18 +47,43 @@ TEST(LoggerTest, LogLevels) {
else
EXPECT_EQ(MOJO_LOG_LEVEL_FATAL, logger->GetMinimumLogLevel());
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, "Logged at VERBOSE-1 level");
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, "Logged at VERBOSE level");
- logger->LogMessage(MOJO_LOG_LEVEL_INFO, "Logged at INFO level");
- logger->LogMessage(MOJO_LOG_LEVEL_WARNING, "Logged at WARNING level");
- logger->LogMessage(MOJO_LOG_LEVEL_ERROR, "Logged at ERROR level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, kPath, 123,
+ "Logged at VERBOSE-1 level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, kPath, 123,
+ "Logged at VERBOSE level");
+ logger->LogMessage(MOJO_LOG_LEVEL_INFO, kPath, 123, "Logged at INFO level");
+ logger->LogMessage(MOJO_LOG_LEVEL_WARNING, kPath, 123,
+ "Logged at WARNING level");
+ logger->LogMessage(MOJO_LOG_LEVEL_ERROR, kPath, 123,
+ "Logged at ERROR level");
// This should kill us:
- EXPECT_DEATH_IF_SUPPORTED(
- { logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level"); },
- "");
+ EXPECT_DEATH_IF_SUPPORTED({
+ logger->LogMessage(MOJO_LOG_LEVEL_FATAL, kPath, 123,
+ "Logged at FATAL level");
+ }, "");
}
}
+TEST(LoggerTest, NoFile) {
+ Environment environment;
+ const MojoLogger* const logger = Environment::GetDefaultLogger();
+
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, nullptr, 0,
+ "Logged at VERBOSE-1 level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, nullptr, 0,
+ "Logged at VERBOSE level");
+ logger->LogMessage(MOJO_LOG_LEVEL_INFO, nullptr, 0, "Logged at INFO level");
+ logger->LogMessage(MOJO_LOG_LEVEL_WARNING, nullptr, 0,
+ "Logged at WARNING level");
+ logger->LogMessage(MOJO_LOG_LEVEL_ERROR, nullptr, 0, "Logged at ERROR level");
+
+ // This should kill us:
+ EXPECT_DEATH_IF_SUPPORTED({
+ logger->LogMessage(MOJO_LOG_LEVEL_FATAL, nullptr, 0,
+ "Logged at FATAL level");
+ }, "");
+}
+
} // namespace
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698