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

Side by Side Diff: dbus/bus_unittest.cc

Issue 1867253002: Convert //dbus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixes in //device Created 4 years, 8 months 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/bus.cc ('k') | dbus/dbus_statistics.cc » ('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 "dbus/bus.h" 5 #include "dbus/bus.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 30 matching lines...) Expand all
41 41
42 void QuitIfConditionIsSatisified() { 42 void QuitIfConditionIsSatisified() {
43 if (++actual_quit_calls_ != expected_quit_calls_) 43 if (++actual_quit_calls_ != expected_quit_calls_)
44 return; 44 return;
45 run_loop_->Quit(); 45 run_loop_->Quit();
46 expected_quit_calls_ = 0; 46 expected_quit_calls_ = 0;
47 actual_quit_calls_ = 0; 47 actual_quit_calls_ = 0;
48 } 48 }
49 49
50 private: 50 private:
51 scoped_ptr<base::RunLoop> run_loop_; 51 std::unique_ptr<base::RunLoop> run_loop_;
52 int expected_quit_calls_; 52 int expected_quit_calls_;
53 int actual_quit_calls_; 53 int actual_quit_calls_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(RunLoopWithExpectedCount); 55 DISALLOW_COPY_AND_ASSIGN(RunLoopWithExpectedCount);
56 }; 56 };
57 57
58 // Test helper for BusTest.ListenForServiceOwnerChange. 58 // Test helper for BusTest.ListenForServiceOwnerChange.
59 void OnServiceOwnerChanged(RunLoopWithExpectedCount* run_loop_state, 59 void OnServiceOwnerChanged(RunLoopWithExpectedCount* run_loop_state,
60 std::string* service_owner, 60 std::string* service_owner,
61 int* num_of_owner_changes, 61 int* num_of_owner_changes,
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // Connection name is not empty after connection is established. 409 // Connection name is not empty after connection is established.
410 EXPECT_TRUE(bus->is_connected()); 410 EXPECT_TRUE(bus->is_connected());
411 EXPECT_FALSE(bus->GetConnectionName().empty()); 411 EXPECT_FALSE(bus->GetConnectionName().empty());
412 412
413 // Shut down synchronously. 413 // Shut down synchronously.
414 bus->ShutdownAndBlock(); 414 bus->ShutdownAndBlock();
415 EXPECT_TRUE(bus->shutdown_completed()); 415 EXPECT_TRUE(bus->shutdown_completed());
416 } 416 }
417 417
418 } // namespace dbus 418 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/bus.cc ('k') | dbus/dbus_statistics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698