1// Copyright 2014 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_client_bundle.h"
6
7#include "base/basictypes.h"
8#include "base/compiler_specific.h"
9#include "testing/gtest/include/gtest/gtest.h"
10
11namespace chromeos {
12
13TEST(DBusClientBundleTest, UnstubFlagParser) {
14  EXPECT_EQ(0, DBusClientBundle::ParseUnstubList("foo"));
15
16  EXPECT_EQ(DBusClientBundle::BLUETOOTH,
17            DBusClientBundle::ParseUnstubList("BLUETOOTH"));
18
19  EXPECT_EQ(DBusClientBundle::BLUETOOTH,
20            DBusClientBundle::ParseUnstubList("bluetooth"));
21
22  EXPECT_EQ(
23      DBusClientBundle::CRAS |
24          DBusClientBundle::CROS_DISKS |
25          DBusClientBundle::DEBUG_DAEMON |
26          DBusClientBundle::SHILL,
27      DBusClientBundle::ParseUnstubList(
28            "Cras,Cros_Disks,debug_daemon,Shill"));
29
30  EXPECT_EQ(
31      DBusClientBundle::CRAS |
32          DBusClientBundle::CROS_DISKS |
33          DBusClientBundle::DEBUG_DAEMON |
34          DBusClientBundle::SHILL,
35      DBusClientBundle::ParseUnstubList(
36            "foo,Cras,Cros_Disks,debug_daemon,Shill"));
37}
38
39}  // namespace chromeos
40