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

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

Issue 575503003: Remove implicit conversions from scoped_refptr to T* in device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_socket_chromeos.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 adapter_(adapter) { 49 adapter_(adapter) {
50 adapter_->AddObserver(this); 50 adapter_->AddObserver(this);
51 } 51 }
52 52
53 virtual ~TestObserver() { 53 virtual ~TestObserver() {
54 adapter_->RemoveObserver(this); 54 adapter_->RemoveObserver(this);
55 } 55 }
56 56
57 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, 57 virtual void AdapterPresentChanged(BluetoothAdapter* adapter,
58 bool present) OVERRIDE { 58 bool present) OVERRIDE {
59 EXPECT_EQ(adapter_, adapter); 59 EXPECT_EQ(adapter_.get(), adapter);
60 60
61 ++present_changed_count_; 61 ++present_changed_count_;
62 last_present_ = present; 62 last_present_ = present;
63 } 63 }
64 64
65 virtual void AdapterPoweredChanged(BluetoothAdapter* adapter, 65 virtual void AdapterPoweredChanged(BluetoothAdapter* adapter,
66 bool powered) OVERRIDE { 66 bool powered) OVERRIDE {
67 EXPECT_EQ(adapter_, adapter); 67 EXPECT_EQ(adapter_.get(), adapter);
68 68
69 ++powered_changed_count_; 69 ++powered_changed_count_;
70 last_powered_ = powered; 70 last_powered_ = powered;
71 } 71 }
72 72
73 virtual void AdapterDiscoverableChanged(BluetoothAdapter* adapter, 73 virtual void AdapterDiscoverableChanged(BluetoothAdapter* adapter,
74 bool discoverable) OVERRIDE { 74 bool discoverable) OVERRIDE {
75 EXPECT_EQ(adapter_, adapter); 75 EXPECT_EQ(adapter_.get(), adapter);
76 76
77 ++discoverable_changed_count_; 77 ++discoverable_changed_count_;
78 } 78 }
79 79
80 virtual void AdapterDiscoveringChanged(BluetoothAdapter* adapter, 80 virtual void AdapterDiscoveringChanged(BluetoothAdapter* adapter,
81 bool discovering) OVERRIDE { 81 bool discovering) OVERRIDE {
82 EXPECT_EQ(adapter_, adapter); 82 EXPECT_EQ(adapter_.get(), adapter);
83 83
84 ++discovering_changed_count_; 84 ++discovering_changed_count_;
85 last_discovering_ = discovering; 85 last_discovering_ = discovering;
86 } 86 }
87 87
88 virtual void DeviceAdded(BluetoothAdapter* adapter, 88 virtual void DeviceAdded(BluetoothAdapter* adapter,
89 BluetoothDevice* device) OVERRIDE { 89 BluetoothDevice* device) OVERRIDE {
90 EXPECT_EQ(adapter_, adapter); 90 EXPECT_EQ(adapter_.get(), adapter);
91 91
92 ++device_added_count_; 92 ++device_added_count_;
93 last_device_ = device; 93 last_device_ = device;
94 last_device_address_ = device->GetAddress(); 94 last_device_address_ = device->GetAddress();
95 95
96 QuitMessageLoop(); 96 QuitMessageLoop();
97 } 97 }
98 98
99 virtual void DeviceChanged(BluetoothAdapter* adapter, 99 virtual void DeviceChanged(BluetoothAdapter* adapter,
100 BluetoothDevice* device) OVERRIDE { 100 BluetoothDevice* device) OVERRIDE {
101 EXPECT_EQ(adapter_, adapter); 101 EXPECT_EQ(adapter_.get(), adapter);
102 102
103 ++device_changed_count_; 103 ++device_changed_count_;
104 last_device_ = device; 104 last_device_ = device;
105 last_device_address_ = device->GetAddress(); 105 last_device_address_ = device->GetAddress();
106 106
107 QuitMessageLoop(); 107 QuitMessageLoop();
108 } 108 }
109 109
110 virtual void DeviceRemoved(BluetoothAdapter* adapter, 110 virtual void DeviceRemoved(BluetoothAdapter* adapter,
111 BluetoothDevice* device) OVERRIDE { 111 BluetoothDevice* device) OVERRIDE {
112 EXPECT_EQ(adapter_, adapter); 112 EXPECT_EQ(adapter_.get(), adapter);
113 113
114 ++device_removed_count_; 114 ++device_removed_count_;
115 // Can't save device, it may be freed 115 // Can't save device, it may be freed
116 last_device_address_ = device->GetAddress(); 116 last_device_address_ = device->GetAddress();
117 117
118 QuitMessageLoop(); 118 QuitMessageLoop();
119 } 119 }
120 120
121 int present_changed_count_; 121 int present_changed_count_;
122 int powered_changed_count_; 122 int powered_changed_count_;
(...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 // Unknown vendor specification identifier. 3176 // Unknown vendor specification identifier.
3177 properties->modalias.ReplaceValue("chrome:v00E0p2400d0400"); 3177 properties->modalias.ReplaceValue("chrome:v00E0p2400d0400");
3178 3178
3179 EXPECT_EQ(BluetoothDevice::VENDOR_ID_UNKNOWN, device->GetVendorIDSource()); 3179 EXPECT_EQ(BluetoothDevice::VENDOR_ID_UNKNOWN, device->GetVendorIDSource());
3180 EXPECT_EQ(0, device->GetVendorID()); 3180 EXPECT_EQ(0, device->GetVendorID());
3181 EXPECT_EQ(0, device->GetProductID()); 3181 EXPECT_EQ(0, device->GetProductID());
3182 EXPECT_EQ(0, device->GetDeviceID()); 3182 EXPECT_EQ(0, device->GetDeviceID());
3183 } 3183 }
3184 3184
3185 } // namespace chromeos 3185 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_socket_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698