OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "dbus/dbus_statistics.h" | 5 #include "dbus/dbus_statistics.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
11 namespace dbus { | 11 namespace dbus { |
12 | 12 |
13 class DBusStatisticsTest : public testing::Test { | 13 class DBusStatisticsTest : public testing::Test { |
14 public: | 14 public: |
15 DBusStatisticsTest() { | 15 DBusStatisticsTest() { |
16 } | 16 } |
17 | 17 |
18 virtual void SetUp() override { | 18 void SetUp() override { statistics::Initialize(); } |
19 statistics::Initialize(); | |
20 } | |
21 | 19 |
22 virtual void TearDown() override { | 20 void TearDown() override { statistics::Shutdown(); } |
23 statistics::Shutdown(); | |
24 } | |
25 | 21 |
26 protected: | 22 protected: |
27 void AddTestMethodCalls() { | 23 void AddTestMethodCalls() { |
28 statistics::AddSentMethodCall( | 24 statistics::AddSentMethodCall( |
29 "service1", "service1.interface1", "method1"); | 25 "service1", "service1.interface1", "method1"); |
30 statistics::AddReceivedSignal( | 26 statistics::AddReceivedSignal( |
31 "service1", "service1.interface1", "method1"); | 27 "service1", "service1.interface1", "method1"); |
32 statistics::AddBlockingSentMethodCall( | 28 statistics::AddBlockingSentMethodCall( |
33 "service1", "service1.interface1", "method1"); | 29 "service1", "service1.interface1", "method1"); |
34 | 30 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 "service1.interface1.method2: Sent: 2 Received: 1\n" | 170 "service1.interface1.method2: Sent: 2 Received: 1\n" |
175 "service1.interface1.method3: Sent: 3\n" | 171 "service1.interface1.method3: Sent: 3\n" |
176 "service1.interface2.method1: Sent: 1\n" | 172 "service1.interface2.method1: Sent: 1\n" |
177 "service1.interface2.method2: Sent: 1\n" | 173 "service1.interface2.method2: Sent: 1\n" |
178 "service2.interface1.method1: Sent: 1\n"); | 174 "service2.interface1.method1: Sent: 1\n"); |
179 EXPECT_EQ(expected_output_method, output_method); | 175 EXPECT_EQ(expected_output_method, output_method); |
180 | 176 |
181 } | 177 } |
182 | 178 |
183 } // namespace dbus | 179 } // namespace dbus |
OLD | NEW |