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

Unified Diff: chromeos/dbus/dbus_thread_manager_unittest.cc

Issue 2338063002: chromeos: Refactor D-Bus client type enum and stub vs. fake naming (Closed)
Patch Set: review comments 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.h » ('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..56c9baeac0b7553928b3e5e5eac8705f654260b6
--- /dev/null
+++ b/chromeos/dbus/dbus_thread_manager_unittest.cc
@@ -0,0 +1,32 @@
+// 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 "chromeos/dbus/dbus_client_types.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+
+// Tests that clients can be created.
+TEST(DBusThreadManagerTest, Initialize) {
+ DBusThreadManager::Initialize();
+ EXPECT_TRUE(DBusThreadManager::IsInitialized());
+
+ DBusThreadManager* manager = DBusThreadManager::Get();
+ ASSERT_TRUE(manager);
+
+ // In tests, clients are fake.
+ EXPECT_TRUE(manager->IsUsingFake(DBusClientType::CRAS));
+ EXPECT_TRUE(manager->IsUsingFake(DBusClientType::CROS_DISKS));
+
+ // Clients were created.
+ EXPECT_TRUE(manager->GetCrasAudioClient());
+ EXPECT_TRUE(manager->GetCrosDisksClient());
+
+ DBusThreadManager::Shutdown();
+ EXPECT_FALSE(DBusThreadManager::IsInitialized());
+}
+
+} // namespace chromeos
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/power_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698