| 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 "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace chromeos { |
| 10 |
| 11 // Tests that a subset of clients can be created. |
| 12 TEST(DBusThreadManagerTest, CreateWithPartialClients) { |
| 13 const DBusClientTypeMask clients = |
| 14 DBusClientBundle::CRAS | DBusClientBundle::CROS_DISKS; |
| 15 DBusThreadManager::Initialize(clients); |
| 16 EXPECT_TRUE(DBusThreadManager::IsInitialized()); |
| 17 |
| 18 DBusThreadManager* manager = DBusThreadManager::Get(); |
| 19 ASSERT_TRUE(manager); |
| 20 |
| 21 // In tests, clients are fake. |
| 22 EXPECT_TRUE(manager->IsUsingFake(DBusClientBundle::CRAS)); |
| 23 EXPECT_TRUE(manager->IsUsingFake(DBusClientBundle::CROS_DISKS)); |
| 24 |
| 25 // Requested clients were created. |
| 26 EXPECT_TRUE(manager->GetCrasAudioClient()); |
| 27 EXPECT_TRUE(manager->GetCrosDisksClient()); |
| 28 |
| 29 // Non-requested clients were skipped. |
| 30 EXPECT_FALSE(manager->GetSystemClockClient()); |
| 31 EXPECT_FALSE(manager->GetUpdateEngineClient()); |
| 32 |
| 33 DBusThreadManager::Shutdown(); |
| 34 } |
| 35 |
| 36 } // namespace chromeos |
| OLD | NEW |