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

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

Issue 322003002: Mojo message validation tests: add integration tests and move existing conformance tests. (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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/lib/validation_errors.cc
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.cc b/mojo/public/cpp/bindings/lib/validation_errors.cc
index 03201b94c2432c9c93b7432d569744a473bc79c6..ed5904d396318d123add33def50deda889688078 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.cc
+++ b/mojo/public/cpp/bindings/lib/validation_errors.cc
@@ -31,8 +31,8 @@ const char* ValidationErrorToString(ValidationError error) {
return "VALIDATION_ERROR_ILLEGAL_HANDLE";
case VALIDATION_ERROR_ILLEGAL_POINTER:
return "VALIDATION_ERROR_ILLEGAL_POINTER";
- case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINAION:
- return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINAION";
+ case VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION:
+ return "VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAG_COMBINATION";
case VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID:
return "VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID";
}
@@ -41,10 +41,12 @@ const char* ValidationErrorToString(ValidationError error) {
}
void ReportValidationError(ValidationError error) {
- // TODO(yzshen): Consider adding better logging support.
- fprintf(stderr, "Invalid message: %s\n", ValidationErrorToString(error));
- if (g_validation_error_observer)
+ if (g_validation_error_observer) {
g_validation_error_observer->set_last_error(error);
+ } else {
+ // TODO(yzshen): Consider adding better logging support.
+ fprintf(stderr, "Invalid message: %s\n", ValidationErrorToString(error));
+ }
}
ValidationErrorObserverForTesting::ValidationErrorObserverForTesting()
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.h ('k') | mojo/public/cpp/bindings/tests/validation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698