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

Side by Side Diff: device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc

Issue 2310883003: dbus: No dbus::FileDescriptor in BluetoothProfileServiceProvider (Closed)
Patch Set: Fix tests Created 4 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 "device/bluetooth/bluez/bluetooth_adapter_profile_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_adapter_profile_bluez.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 device_path_ = dbus::ObjectPath(device_path); 90 device_path_ = dbus::ObjectPath(device_path);
91 } 91 }
92 92
93 // bluez::BluetoothProfileServiceProvider::Delegate: 93 // bluez::BluetoothProfileServiceProvider::Delegate:
94 void Released() override { 94 void Released() override {
95 // noop 95 // noop
96 } 96 }
97 97
98 void NewConnection( 98 void NewConnection(
99 const dbus::ObjectPath& device_path, 99 const dbus::ObjectPath& device_path,
100 std::unique_ptr<dbus::FileDescriptor> fd, 100 base::ScopedFD fd,
101 const bluez::BluetoothProfileServiceProvider::Delegate::Options& 101 const bluez::BluetoothProfileServiceProvider::Delegate::Options&
102 options, 102 options,
103 const ConfirmationCallback& callback) override { 103 const ConfirmationCallback& callback) override {
104 ++connections_; 104 ++connections_;
105 fd->CheckValidity(); 105 fd.reset();
Rahul Chaturvedi 2016/09/06 23:01:19 We no longer care to check validity?
hashimoto 2016/09/07 05:55:17 This "validity" check was introduced to avoid send
106 close(fd->TakeValue());
107 callback.Run(SUCCESS); 106 callback.Run(SUCCESS);
108 if (device_path_.value() != "") 107 if (device_path_.value() != "")
109 ASSERT_EQ(device_path_, device_path); 108 ASSERT_EQ(device_path_, device_path);
110 } 109 }
111 110
112 void RequestDisconnection(const dbus::ObjectPath& device_path, 111 void RequestDisconnection(const dbus::ObjectPath& device_path,
113 const ConfirmationCallback& callback) override { 112 const ConfirmationCallback& callback) override {
114 ++disconnections_; 113 ++disconnections_;
115 } 114 }
116 115
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 base::Unretained(this))); 381 base::Unretained(this)));
383 382
384 base::RunLoop().RunUntilIdle(); 383 base::RunLoop().RunUntilIdle();
385 384
386 EXPECT_FALSE(profile_user_ptr_); 385 EXPECT_FALSE(profile_user_ptr_);
387 EXPECT_EQ(0U, success_callback_count_); 386 EXPECT_EQ(0U, success_callback_count_);
388 EXPECT_EQ(2U, error_callback_count_); 387 EXPECT_EQ(2U, error_callback_count_);
389 } 388 }
390 389
391 } // namespace bluez 390 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_adapter_profile_bluez.cc ('k') | device/bluetooth/bluez/bluetooth_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698