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

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

Issue 2633053002: Remove the MessageLoop::DestructionObserver from mojo bindings. (Closed)
Patch Set: rebase Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/device.h" 5 #include "device/bluetooth/device.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 proxy_.set_connection_error_handler( 135 proxy_.set_connection_error_handler(
136 base::Bind(&BluetoothInterfaceDeviceTest::OnConnectionError, 136 base::Bind(&BluetoothInterfaceDeviceTest::OnConnectionError,
137 weak_factory_.GetWeakPtr())); 137 weak_factory_.GetWeakPtr()));
138 } 138 }
139 139
140 void TearDown() override { 140 void TearDown() override {
141 EXPECT_EQ(expected_success_callback_calls_, actual_success_callback_calls_); 141 EXPECT_EQ(expected_success_callback_calls_, actual_success_callback_calls_);
142 EXPECT_EQ(message_pipe_closed_, expect_device_service_deleted_); 142 EXPECT_EQ(message_pipe_closed_, expect_device_service_deleted_);
143 proxy_.reset(); 143 proxy_.reset();
144 base::RunLoop().RunUntilIdle();
144 } 145 }
145 146
146 protected: 147 protected:
147 void OnConnectionError() { message_pipe_closed_ = true; } 148 void OnConnectionError() { message_pipe_closed_ = true; }
148 149
149 void SimulateGattServicesDiscovered() { 150 void SimulateGattServicesDiscovered() {
150 for (auto& observer : adapter_->GetObservers()) 151 for (auto& observer : adapter_->GetObservers())
151 observer.GattServicesDiscovered(adapter_.get(), &device_); 152 observer.GattServicesDiscovered(adapter_.get(), &device_);
152 } 153 }
153 154
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 EXPECT_EQ(0, actual_callback_count_); 267 EXPECT_EQ(0, actual_callback_count_);
267 268
268 // Simulate connection loss. 269 // Simulate connection loss.
269 proxy_->Disconnect(); 270 proxy_->Disconnect();
270 expect_device_service_deleted_ = true; 271 expect_device_service_deleted_ = true;
271 272
272 // Wait for message pipe to process error. 273 // Wait for message pipe to process error.
273 base::RunLoop().RunUntilIdle(); 274 base::RunLoop().RunUntilIdle();
274 } 275 }
275 } // namespace bluetooth 276 } // namespace bluetooth
OLDNEW
« no previous file with comments | « content/renderer/presentation/presentation_dispatcher.cc ('k') | device/usb/mojo/device_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698