Commit 507b512d authored by Oleh Lamzin's avatar Oleh Lamzin Committed by Commit Bot

[Telemetry SWX] Use FlushForTesting instead of RunUntilIdle

Use new method ServiceConnection::FlushForTesting instead of
RunUntilIdle.

Change-Id: Idfa4a5fdd3eb8ab43be0d5ed527e334a6401c821
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398624Reviewed-by: default avatarMahmoud Gawad <mgawad@google.com>
Commit-Queue: Oleh Lamzin <lamzin@google.com>
Cr-Commit-Position: refs/heads/master@{#805657}
parent d14cff78
...@@ -54,6 +54,7 @@ source_set("unit_tests") { ...@@ -54,6 +54,7 @@ source_set("unit_tests") {
"//chrome/browser/chromeos/wilco_dtc_supportd:mojo_utils", "//chrome/browser/chromeos/wilco_dtc_supportd:mojo_utils",
"//chromeos/components/telemetry_extension_ui/mojom", "//chromeos/components/telemetry_extension_ui/mojom",
"//chromeos/dbus/cros_healthd", "//chromeos/dbus/cros_healthd",
"//chromeos/services/cros_healthd/public/cpp",
"//chromeos/services/cros_healthd/public/mojom", "//chromeos/services/cros_healthd/public/mojom",
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "chromeos/dbus/cros_healthd/cros_healthd_client.h" #include "chromeos/dbus/cros_healthd/cros_healthd_client.h"
#include "chromeos/dbus/cros_healthd/fake_cros_healthd_client.h" #include "chromeos/dbus/cros_healthd/fake_cros_healthd_client.h"
#include "chromeos/services/cros_healthd/public/cpp/service_connection.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -28,9 +29,8 @@ class ProbeServiceTest : public testing::Test { ...@@ -28,9 +29,8 @@ class ProbeServiceTest : public testing::Test {
void TearDown() override { void TearDown() override {
CrosHealthdClient::Shutdown(); CrosHealthdClient::Shutdown();
// Wait for cros_healthd::ServiceConnection to observe the destruction of // Wait for ServiceConnection to observe the destruction of the client.
// the client. cros_healthd::ServiceConnection::GetInstance()->FlushForTesting();
base::RunLoop().RunUntilIdle();
} }
health::mojom::ProbeServiceProxy* probe_service() const { health::mojom::ProbeServiceProxy* probe_service() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment