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

Side by Side Diff: mojo/public/cpp/environment/tests/logger_unittest.cc

Issue 330933004: Mojo: Add basic logging facilities to environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/environment/default_logger.h"
6 #include "mojo/public/cpp/environment/environment.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace mojo {
10 namespace {
11
12 TEST(LoggerTest, Basic) {
13 Environment environment;
14 const MojoLogger* const logger = GetDefaultLogger();
15
16 logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE-1, "Logged at VERBOSE-1 level");
17 logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, "Logged at VERBOSE level");
18 logger->LogMessage(MOJO_LOG_LEVEL_INFO, "Logged at INFO level");
19 logger->LogMessage(MOJO_LOG_LEVEL_WARNING, "Logged at WARNING level");
20 logger->LogMessage(MOJO_LOG_LEVEL_ERROR, "Logged at ERROR level");
21
22 // This should kill us:
23 EXPECT_DEATH({
24 logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level");
25 }, "");
26 }
27
28 } // namespace
29 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698