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

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

Issue 644963004: Some more virtual/override updates. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "mojo/public/cpp/environment/environment.h" 10 #include "mojo/public/cpp/environment/environment.h"
(...skipping 17 matching lines...) Expand all
28 *was_called = true; 28 *was_called = true;
29 return false; 29 return false;
30 } 30 }
31 31
32 class LoggingTest : public testing::Test { 32 class LoggingTest : public testing::Test {
33 public: 33 public:
34 LoggingTest() : environment_(nullptr, &kMockLogger) { 34 LoggingTest() : environment_(nullptr, &kMockLogger) {
35 minimum_log_level_ = MOJO_LOG_LEVEL_INFO; 35 minimum_log_level_ = MOJO_LOG_LEVEL_INFO;
36 ResetMockLogger(); 36 ResetMockLogger();
37 } 37 }
38 virtual ~LoggingTest() {} 38 ~LoggingTest() override {}
39 39
40 protected: 40 protected:
41 // Note: Does not reset |minimum_log_level_|. 41 // Note: Does not reset |minimum_log_level_|.
42 static void ResetMockLogger() { 42 static void ResetMockLogger() {
43 log_message_was_called_ = false; 43 log_message_was_called_ = false;
44 last_log_level_ = MOJO_LOG_LEVEL_INFO; 44 last_log_level_ = MOJO_LOG_LEVEL_INFO;
45 last_message_.clear(); 45 last_message_.clear();
46 } 46 }
47 47
48 // A function returning |bool| that shouldn't be called. 48 // A function returning |bool| that shouldn't be called.
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 ResetMockLogger(); 470 ResetMockLogger();
471 471
472 // Also try to make sure that we parenthesize the condition properly. 472 // Also try to make sure that we parenthesize the condition properly.
473 bool x = true; 473 bool x = true;
474 MOJO_DCHECK(false || x) << "hello"; 474 MOJO_DCHECK(false || x) << "hello";
475 EXPECT_FALSE(log_message_was_called()); 475 EXPECT_FALSE(log_message_was_called());
476 } 476 }
477 477
478 } // namespace 478 } // namespace
479 } // namespace mojo 479 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/environment/tests/async_waiter_unittest.cc ('k') | mojo/public/cpp/utility/tests/run_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698