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

Side by Side Diff: dbus/signal_sender_verification_unittest.cc

Issue 802213003: Standardize usage of virtual/override/final specifiers in dbus/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « dbus/property_unittest.cc ('k') | dbus/test_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop.h" 7 #include "base/message_loop/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 10 matching lines...) Expand all
21 namespace dbus { 21 namespace dbus {
22 22
23 // The test for sender verification in ObjectProxy. 23 // The test for sender verification in ObjectProxy.
24 class SignalSenderVerificationTest : public testing::Test { 24 class SignalSenderVerificationTest : public testing::Test {
25 public: 25 public:
26 SignalSenderVerificationTest() 26 SignalSenderVerificationTest()
27 : on_name_owner_changed_called_(false), 27 : on_name_owner_changed_called_(false),
28 on_ownership_called_(false) { 28 on_ownership_called_(false) {
29 } 29 }
30 30
31 virtual void SetUp() { 31 void SetUp() override {
32 base::StatisticsRecorder::Initialize(); 32 base::StatisticsRecorder::Initialize();
33 33
34 // Make the main thread not to allow IO. 34 // Make the main thread not to allow IO.
35 base::ThreadRestrictions::SetIOAllowed(false); 35 base::ThreadRestrictions::SetIOAllowed(false);
36 36
37 // Start the D-Bus thread. 37 // Start the D-Bus thread.
38 dbus_thread_.reset(new base::Thread("D-Bus Thread")); 38 dbus_thread_.reset(new base::Thread("D-Bus Thread"));
39 base::Thread::Options thread_options; 39 base::Thread::Options thread_options;
40 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; 40 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
41 ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options)); 41 ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ASSERT_FALSE(test_service2_->has_ownership()); 87 ASSERT_FALSE(test_service2_->has_ownership());
88 88
89 // The name should be owned and known at this point. 89 // The name should be owned and known at this point.
90 if (!on_name_owner_changed_called_) { 90 if (!on_name_owner_changed_called_) {
91 run_loop_.reset(new base::RunLoop); 91 run_loop_.reset(new base::RunLoop);
92 run_loop_->Run(); 92 run_loop_->Run();
93 } 93 }
94 ASSERT_FALSE(latest_name_owner_.empty()); 94 ASSERT_FALSE(latest_name_owner_.empty());
95 } 95 }
96 96
97 virtual void TearDown() { 97 void TearDown() override {
98 bus_->ShutdownOnDBusThreadAndBlock(); 98 bus_->ShutdownOnDBusThreadAndBlock();
99 99
100 // Shut down the service. 100 // Shut down the service.
101 test_service_->ShutdownAndBlock(); 101 test_service_->ShutdownAndBlock();
102 test_service2_->ShutdownAndBlock(); 102 test_service2_->ShutdownAndBlock();
103 103
104 // Reset to the default. 104 // Reset to the default.
105 base::ThreadRestrictions::SetIOAllowed(true); 105 base::ThreadRestrictions::SetIOAllowed(true);
106 106
107 // Stopping a thread is considered an IO operation, so do this after 107 // Stopping a thread is considered an IO operation, so do this after
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 // Now the second service owns the name. 393 // Now the second service owns the name.
394 const char kNewMessage[] = "hello, new world"; 394 const char kNewMessage[] = "hello, new world";
395 395
396 test_service2_->SendTestSignal(kNewMessage); 396 test_service2_->SendTestSignal(kNewMessage);
397 WaitForTestSignal(); 397 WaitForTestSignal();
398 ASSERT_EQ(kNewMessage, test_signal_string_); 398 ASSERT_EQ(kNewMessage, test_signal_string_);
399 } 399 }
400 400
401 } // namespace dbus 401 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/property_unittest.cc ('k') | dbus/test_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698