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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« 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