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

Unified Diff: chromeos/dbus/dbus_thread_manager_unittest.cc

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome Created 4 years, 3 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 | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/dbus_thread_manager_unittest.cc
diff --git a/chromeos/dbus/dbus_thread_manager_unittest.cc b/chromeos/dbus/dbus_thread_manager_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bdeee0ac0a3f3c6c5fb00340776b81b4ced2c913
--- /dev/null
+++ b/chromeos/dbus/dbus_thread_manager_unittest.cc
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/dbus/dbus_thread_manager.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+
+// Tests that a subset of clients can be created.
+TEST(DBusThreadManagerTest, CreateWithPartialClients) {
+ const DBusClientTypeMask clients =
+ DBusClientBundle::CRAS | DBusClientBundle::CROS_DISKS;
+ DBusThreadManager::Initialize(clients);
+ EXPECT_TRUE(DBusThreadManager::IsInitialized());
+
+ DBusThreadManager* manager = DBusThreadManager::Get();
+ ASSERT_TRUE(manager);
+
+ // In tests, clients are fake.
+ EXPECT_TRUE(manager->IsUsingFake(DBusClientBundle::CRAS));
+ EXPECT_TRUE(manager->IsUsingFake(DBusClientBundle::CROS_DISKS));
+
+ // Requested clients were created.
+ EXPECT_TRUE(manager->GetCrasAudioClient());
+ EXPECT_TRUE(manager->GetCrosDisksClient());
+
+ // Non-requested clients were skipped.
+ EXPECT_FALSE(manager->GetSystemClockClient());
+ EXPECT_FALSE(manager->GetUpdateEngineClient());
+
+ DBusThreadManager::Shutdown();
+}
+
+} // namespace chromeos
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698