Index: base/test/logging_utils.h |
diff --git a/base/test/logging_utils.h b/base/test/logging_utils.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..310adefbdc9311c4afbc8341bc5e9cbab12a1747 |
--- /dev/null |
+++ b/base/test/logging_utils.h |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
Paweł Hajdan Jr.
2017/01/27 17:19:44
nit: 2017, no (c).
alex-ac
2017/02/11 20:12:20
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TEST_LOGGING_UTILS_H_ |
+#define BASE_TEST_LOGGING_UTILS_H_ |
+ |
+#include "base/base_export.h" |
+#include "base/callback.h" |
+#include "base/logging.h" |
+ |
+namespace logging { |
+ |
+// Scoped object to set and restore Log Assert handler. |
+BASE_EXPORT class ScopedLogAssertHandler { |
+ public: |
+ ScopedLogAssertHandler(); |
+ explicit ScopedLogAssertHandler(LogAssertHandlerFunction handler); |
+ ScopedLogAssertHandler(ScopedLogAssertHandler&& other); |
+ ~ScopedLogAssertHandler(); |
+ |
+ ScopedLogAssertHandler& operator=(ScopedLogAssertHandler&& other); |
+ |
+ private: |
Paweł Hajdan Jr.
2017/01/27 17:19:44
nit: DISALLOW_COPY_AND_ASSIGN?
alex-ac
2017/02/11 20:12:20
Done.
|
+ LogAssertHandlerFunction handler_; |
+}; |
+ |
+} // namespace logging |
+ |
+#endif // BASE_TEST_LOGGING_UTILS_H_ |