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

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

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/cpp/bindings/tests/union_unittest.cc ('k') | mojo/public/cpp/environment/logging.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/validation_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
index 290f3335c0d6eea2adc2b54269d5cecd837b12a3..bb1c74505519f04fefd6610940b0c720aafe6db4 100644
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
@@ -11,6 +11,7 @@
#include <vector>
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "mojo/message_pump/message_pump_mojo.h"
#include "mojo/public/c/system/macros.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -171,8 +172,12 @@ void RunValidationTests(const std::string& prefix,
ASSERT_TRUE(ReadTestCase(tests[i], &message, &expected));
std::string result;
- mojo::internal::ValidationErrorObserverForTesting observer;
+ base::RunLoop run_loop;
+ mojo::internal::ValidationErrorObserverForTesting observer(
+ run_loop.QuitClosure());
mojo_ignore_result(test_message_receiver->Accept(&message));
+ if (expected != "PASS") // Observer only gets called on errors.
+ run_loop.Run();
if (observer.last_error() == mojo::internal::VALIDATION_ERROR_NONE)
result = "PASS";
else
@@ -235,9 +240,7 @@ class ValidationIntegrationTest : public ValidationTest {
~TestMessageReceiver() override {}
bool Accept(Message* message) override {
- bool rv = connector_.Accept(message);
- owner_->PumpMessages();
- return rv;
+ return connector_.Accept(message);
}
public:
« no previous file with comments | « mojo/public/cpp/bindings/tests/union_unittest.cc ('k') | mojo/public/cpp/environment/logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698