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

Unified Diff: mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc

Issue 1387993002: mojo::Serialize*_() calls now propogate/return validation errors. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fixed MOJO_DCHECK issues, removed SerializationWarningObserver & addressing trung's CL comments Created 5 years, 2 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/cpp/bindings/tests/map_unittest.cc ('k') | mojo/public/cpp/bindings/tests/struct_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
index b61d3bc57e41482d50bbcbef8eb50b4683d3f132..85b0924a7befda9b6440b30ad50fbd4cd1e83e2a 100644
--- a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
@@ -57,29 +57,21 @@ class SerializationWarningTest : public testing::Test {
template <typename T, typename TPtr>
void TestStructWarningImpl(TPtr obj,
mojo::internal::ValidationError expected_warning) {
- warning_observer_.set_last_warning(mojo::internal::VALIDATION_ERROR_NONE);
-
mojo::internal::FixedBufferForTesting buf(GetSerializedSize_(*obj));
typename T::Data_* data;
- Serialize_(obj.get(), &buf, &data);
-
- EXPECT_EQ(expected_warning, warning_observer_.last_warning());
+ EXPECT_EQ(expected_warning, Serialize_(obj.get(), &buf, &data));
}
template <typename T>
void TestArrayWarning(T obj,
mojo::internal::ValidationError expected_warning,
const ArrayValidateParams* validate_params) {
- warning_observer_.set_last_warning(mojo::internal::VALIDATION_ERROR_NONE);
-
mojo::internal::FixedBufferForTesting buf(GetSerializedSize_(obj));
typename T::Data_* data;
- SerializeArray_(&obj, &buf, &data, validate_params);
-
- EXPECT_EQ(expected_warning, warning_observer_.last_warning());
+ EXPECT_EQ(expected_warning,
+ SerializeArray_(&obj, &buf, &data, validate_params));
}
- mojo::internal::SerializationWarningObserverForTesting warning_observer_;
Environment env_;
};
« no previous file with comments | « mojo/public/cpp/bindings/tests/map_unittest.cc ('k') | mojo/public/cpp/bindings/tests/struct_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698