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

Unified Diff: mojo/public/cpp/bindings/lib/validation_errors.h

Issue 2448203002: Mojo: Suppress validation error logging in some tests (Closed)
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/public/cpp/bindings/lib/validation_errors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/validation_errors.h
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.h b/mojo/public/cpp/bindings/lib/validation_errors.h
index 7636e391dad4414dfff7659a04e75c12e9dd1ff4..122418d9e3d2eee11b5a5d86c3f42a5f802e67d6 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.h
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h
@@ -89,6 +89,20 @@ MOJO_CPP_BINDINGS_EXPORT void ReportValidationErrorForMessage(
ValidationError error,
const char* description = nullptr);
+// This class may be used by tests to suppress validation error logging. This is
+// not thread-safe and must only be instantiated on the main thread with no
+// other threads using Mojo bindings at the time of construction or destruction.
+class MOJO_CPP_BINDINGS_EXPORT ScopedSuppressValidationErrorLoggingForTests {
+ public:
+ ScopedSuppressValidationErrorLoggingForTests();
+ ~ScopedSuppressValidationErrorLoggingForTests();
+
+ private:
+ const bool was_suppressed_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedSuppressValidationErrorLoggingForTests);
+};
+
// Only used by validation tests and when there is only one thread doing message
// validation.
class MOJO_CPP_BINDINGS_EXPORT ValidationErrorObserverForTesting {
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/public/cpp/bindings/lib/validation_errors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698