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

Unified Diff: chromeos/dbus/nfc_client_unittest.cc

Issue 2238703002: chromeos: Avoid org.neard.Manager D-Bus log spam. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oh, gmock Created 4 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
« no previous file with comments | « no previous file | chromeos/dbus/nfc_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/nfc_client_unittest.cc
diff --git a/chromeos/dbus/nfc_client_unittest.cc b/chromeos/dbus/nfc_client_unittest.cc
index 8c9cbf9e773d1b5ad8f30e9e7b7daefa36fb63ab..7e90e47eacff29aeeda5c8ff7b5421856369d2b2 100644
--- a/chromeos/dbus/nfc_client_unittest.cc
+++ b/chromeos/dbus/nfc_client_unittest.cc
@@ -202,6 +202,12 @@ class NfcClientTest : public testing::Test {
dbus::ObjectPath(kTestTagPath1)))
.WillRepeatedly(Return(mock_tag1_proxy_.get()));
+ // Handle |manager_client_|'s request to register a callback
+ // for |mock_manager_proxy_|'s D-Bus service becoming available.
+ EXPECT_CALL(*mock_manager_proxy_.get(), WaitForServiceToBeAvailable(_))
+ .WillRepeatedly(
+ Invoke(this, &NfcClientTest::OnWaitForServiceToBeAvailable));
+
// ShutdownAndBlock will be called in TearDown.
EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return());
@@ -370,6 +376,13 @@ class NfcClientTest : public testing::Test {
dbus::ObjectProxy::SignalCallback manager_adapter_removed_signal_callback_;
private:
+ // Used to inform |manager_client_| that |mock_manager_proxy_| is ready.
+ void OnWaitForServiceToBeAvailable(
+ dbus::ObjectProxy::WaitForServiceToBeAvailableCallback callback) {
+ message_loop_.task_runner()->PostTask(FROM_HERE,
+ base::Bind(callback, true));
+ }
+
// Used to implement the mock proxy.
void OnConnectToSignal(
const std::string& interface_name,
« no previous file with comments | « no previous file | chromeos/dbus/nfc_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698