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

Unified Diff: dbus/object_manager_unittest.cc

Issue 523623003: Plug some of the leaks in dbus_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove MessageLoop::Run() calls everywhere Created 6 years, 4 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: dbus/object_manager_unittest.cc
diff --git a/dbus/object_manager_unittest.cc b/dbus/object_manager_unittest.cc
index 3e53095b12e4fefd7add9d87d6b31caec4b8848a..47b12a4ba9fcf252cda6ae491ad2e7cc08882794 100644
--- a/dbus/object_manager_unittest.cc
+++ b/dbus/object_manager_unittest.cc
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
@@ -105,6 +106,8 @@ class ObjectManagerTest
// Stopping a thread is considered an IO operation, so do this after
// allowing IO.
test_service_->Stop();
+
+ base::RunLoop().RunUntilIdle();
}
void MethodCallback(Response* response) {
@@ -140,7 +143,7 @@ class ObjectManagerTest
void WaitForObject() {
while (added_objects_.size() < kExpectedObjects ||
updated_properties_.size() < kExpectedProperties)
- message_loop_.Run();
+ base::RunLoop().Run();
for (size_t i = 0; i < kExpectedObjects; ++i)
added_objects_.erase(added_objects_.begin());
for (size_t i = 0; i < kExpectedProperties; ++i)
@@ -149,13 +152,13 @@ class ObjectManagerTest
void WaitForRemoveObject() {
while (removed_objects_.size() < kExpectedObjects)
- message_loop_.Run();
+ base::RunLoop().Run();
for (size_t i = 0; i < kExpectedObjects; ++i)
removed_objects_.erase(removed_objects_.begin());
}
void WaitForMethodCallback() {
- message_loop_.Run();
+ base::RunLoop().Run();
method_callback_called_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698