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

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

Issue 1552983003: Fix a bunch of mojo_public_*_unittests with the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 12 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
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.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 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);
};
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.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