OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chromeos/dbus/dbus_thread_manager.h" |
| 6 |
| 7 #include "chromeos/dbus/dbus_client_types.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 namespace chromeos { |
| 11 |
| 12 // Tests that clients can be created. |
| 13 TEST(DBusThreadManagerTest, Initialize) { |
| 14 DBusThreadManager::Initialize(); |
| 15 EXPECT_TRUE(DBusThreadManager::IsInitialized()); |
| 16 |
| 17 DBusThreadManager* manager = DBusThreadManager::Get(); |
| 18 ASSERT_TRUE(manager); |
| 19 |
| 20 // In tests, clients are fake. |
| 21 EXPECT_TRUE(manager->IsUsingFake(DBusClientType::CRAS)); |
| 22 EXPECT_TRUE(manager->IsUsingFake(DBusClientType::CROS_DISKS)); |
| 23 |
| 24 // Clients were created. |
| 25 EXPECT_TRUE(manager->GetCrasAudioClient()); |
| 26 EXPECT_TRUE(manager->GetCrosDisksClient()); |
| 27 |
| 28 DBusThreadManager::Shutdown(); |
| 29 EXPECT_FALSE(DBusThreadManager::IsInitialized()); |
| 30 } |
| 31 |
| 32 } // namespace chromeos |
OLD | NEW |