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

Side by Side Diff: device/bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "chromeos/dbus/bluetooth_profile_service_provider.h" 7 #include "chromeos/dbus/bluetooth_profile_service_provider.h"
8 #include "chromeos/dbus/dbus_thread_manager.h" 8 #include "chromeos/dbus/dbus_thread_manager.h"
9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" 9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h"
10 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" 10 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 DBusThreadManager::Shutdown(); 67 DBusThreadManager::Shutdown();
68 } 68 }
69 69
70 void AdapterCallback(scoped_refptr<BluetoothAdapter> adapter) { 70 void AdapterCallback(scoped_refptr<BluetoothAdapter> adapter) {
71 adapter_ = adapter; 71 adapter_ = adapter;
72 } 72 }
73 73
74 class FakeDelegate 74 class FakeDelegate
75 : public chromeos::BluetoothProfileServiceProvider::Delegate { 75 : public chromeos::BluetoothProfileServiceProvider::Delegate {
76 public: 76 public:
77 FakeDelegate(std::string device_path) : connections_(0) { 77 FakeDelegate(const std::string& device_path) : connections_(0) {
78 device_path_ = dbus::ObjectPath(device_path); 78 device_path_ = dbus::ObjectPath(device_path);
79 } 79 }
80 80
81 // BluetoothProfileServiceProvider::Delegate: 81 // BluetoothProfileServiceProvider::Delegate:
82 void Released() override { 82 void Released() override {
83 // noop 83 // noop
84 } 84 }
85 85
86 void NewConnection( 86 void NewConnection(
87 const dbus::ObjectPath& device_path, 87 const dbus::ObjectPath& device_path,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 base::Unretained(this))); 374 base::Unretained(this)));
375 375
376 message_loop_.RunUntilIdle(); 376 message_loop_.RunUntilIdle();
377 377
378 EXPECT_FALSE(profile_user_ptr_); 378 EXPECT_FALSE(profile_user_ptr_);
379 EXPECT_EQ(0U, success_callback_count_); 379 EXPECT_EQ(0U, success_callback_count_);
380 EXPECT_EQ(2U, error_callback_count_); 380 EXPECT_EQ(2U, error_callback_count_);
381 } 381 }
382 382
383 } // namespace chromeos 383 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698