summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/dbus_client_bundle_unittest.cc
blob: e7f63bd82946429a4c46d23ff291ab1713028536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 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_client_bundle.h"

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace chromeos {

TEST(DBusClientBundleTest, UnstubFlagParser) {
  EXPECT_EQ(0, DBusClientBundle::ParseUnstubList("foo"));

  EXPECT_EQ(DBusClientBundle::BLUETOOTH,
            DBusClientBundle::ParseUnstubList("BLUETOOTH"));

  EXPECT_EQ(DBusClientBundle::BLUETOOTH,
            DBusClientBundle::ParseUnstubList("bluetooth"));

  EXPECT_EQ(
      DBusClientBundle::CRAS |
          DBusClientBundle::CROS_DISKS |
          DBusClientBundle::DEBUG_DAEMON |
          DBusClientBundle::SHILL,
      DBusClientBundle::ParseUnstubList(
            "Cras,Cros_Disks,debug_daemon,Shill"));

  EXPECT_EQ(
      DBusClientBundle::CRAS |
          DBusClientBundle::CROS_DISKS |
          DBusClientBundle::DEBUG_DAEMON |
          DBusClientBundle::SHILL,
      DBusClientBundle::ParseUnstubList(
            "foo,Cras,Cros_Disks,debug_daemon,Shill"));
}

}  // namespace chromeos