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 d1abfdd0e4e1f3177f1970fcf9f03b433f5015b9..80a66fb40140fbc3525525f3a5f1add54172ce4d 100644 |
--- a/mojo/public/cpp/bindings/lib/validation_errors.h |
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h |
@@ -5,6 +5,7 @@ |
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ |
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_ |
+#include "mojo/public/cpp/bindings/callback.h" |
#include "mojo/public/cpp/system/macros.h" |
namespace mojo { |
@@ -70,14 +71,18 @@ void ReportValidationError(ValidationError error, |
// validation. |
class ValidationErrorObserverForTesting { |
public: |
- ValidationErrorObserverForTesting(); |
+ explicit ValidationErrorObserverForTesting(const Callback<void()>& callback); |
~ValidationErrorObserverForTesting(); |
ValidationError last_error() const { return last_error_; } |
- void set_last_error(ValidationError error) { last_error_ = error; } |
+ void set_last_error(ValidationError error) { |
+ last_error_ = error; |
+ callback_.Run(); |
+ } |
private: |
ValidationError last_error_; |
+ Callback<void()> callback_; |
MOJO_DISALLOW_COPY_AND_ASSIGN(ValidationErrorObserverForTesting); |
}; |