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

Side by Side Diff: base/test/mock_log.h

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/test/mock_devices_changed_observer.h ('k') | base/test/opaque_ref_counted.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef BASE_TEST_MOCK_LOG_H_ 5 #ifndef BASE_TEST_MOCK_LOG_H_
6 #define BASE_TEST_MOCK_LOG_H_ 6 #define BASE_TEST_MOCK_LOG_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gtest/googlemock/include/gmock/gmock.h"
14 14
15 namespace base { 15 namespace base {
16 namespace test { 16 namespace test {
17 17
18 // A MockLog object intercepts LOG() messages issued during its lifespan. Using 18 // A MockLog object intercepts LOG() messages issued during its lifespan. Using
19 // this together with gMock, it's very easy to test how a piece of code calls 19 // this together with gMock, it's very easy to test how a piece of code calls
20 // LOG(). The typical usage: 20 // LOG(). The typical usage:
21 // 21 //
22 // TEST(FooTest, LogsCorrectly) { 22 // TEST(FooTest, LogsCorrectly) {
23 // MockLog log; 23 // MockLog log;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // The previous handler to restore when the MockLog is destroyed. 89 // The previous handler to restore when the MockLog is destroyed.
90 logging::LogMessageHandlerFunction previous_handler_; 90 logging::LogMessageHandlerFunction previous_handler_;
91 91
92 DISALLOW_COPY_AND_ASSIGN(MockLog); 92 DISALLOW_COPY_AND_ASSIGN(MockLog);
93 }; 93 };
94 94
95 } // namespace test 95 } // namespace test
96 } // namespace base 96 } // namespace base
97 97
98 #endif // BASE_TEST_MOCK_LOG_H_ 98 #endif // BASE_TEST_MOCK_LOG_H_
OLDNEW
« no previous file with comments | « base/test/mock_devices_changed_observer.h ('k') | base/test/opaque_ref_counted.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698