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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Sleep to have message delivered to the client via the D-Bus service. | 150 // Sleep to have message delivered to the client via the D-Bus service. |
151 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 151 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
152 | 152 |
153 scoped_ptr<base::HistogramSamples> samples2( | 153 scoped_ptr<base::HistogramSamples> samples2( |
154 reject_signal_histogram->SnapshotSamples()); | 154 reject_signal_histogram->SnapshotSamples()); |
155 | 155 |
156 ASSERT_EQ("", test_signal_string_); | 156 ASSERT_EQ("", test_signal_string_); |
157 EXPECT_EQ(samples1->TotalCount() + 1, samples2->TotalCount()); | 157 EXPECT_EQ(samples1->TotalCount() + 1, samples2->TotalCount()); |
158 } | 158 } |
159 | 159 |
160 TEST_F(SignalSenderVerificationTest, TestOwnerChanged) { | 160 TEST_F(SignalSenderVerificationTest, DISABLED_TestOwnerChanged) { |
161 const char kMessage[] = "hello, world"; | 161 const char kMessage[] = "hello, world"; |
162 | 162 |
163 // Send the test signal from the exported object. | 163 // Send the test signal from the exported object. |
164 test_service_->SendTestSignal(kMessage); | 164 test_service_->SendTestSignal(kMessage); |
165 // Receive the signal with the object proxy. The signal is handled in | 165 // Receive the signal with the object proxy. The signal is handled in |
166 // SignalSenderVerificationTest::OnTestSignal() in the main thread. | 166 // SignalSenderVerificationTest::OnTestSignal() in the main thread. |
167 WaitForTestSignal(); | 167 WaitForTestSignal(); |
168 ASSERT_EQ(kMessage, test_signal_string_); | 168 ASSERT_EQ(kMessage, test_signal_string_); |
169 | 169 |
170 // Release and aquire the name ownership. | 170 // Release and aquire the name ownership. |
171 test_service_->ShutdownAndBlock(); | 171 test_service_->ShutdownAndBlock(); |
172 test_service2_->RequestOwnership(); | 172 test_service2_->RequestOwnership(); |
173 | 173 |
174 // Now the second service owns the name. | 174 // Now the second service owns the name. |
175 const char kNewMessage[] = "hello, new world"; | 175 const char kNewMessage[] = "hello, new world"; |
176 | 176 |
177 test_service2_->SendTestSignal(kNewMessage); | 177 test_service2_->SendTestSignal(kNewMessage); |
178 WaitForTestSignal(); | 178 WaitForTestSignal(); |
179 ASSERT_EQ(kNewMessage, test_signal_string_); | 179 ASSERT_EQ(kNewMessage, test_signal_string_); |
180 } | 180 } |
OLD | NEW |