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

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

Issue 2720403003: Remove the MessageLoop::DestructionObserver from mojo bindings. (Closed)
Patch Set: Created 3 years, 9 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 380
380 // Simulate connection loss. 381 // Simulate connection loss.
381 proxy_->Disconnect(); 382 proxy_->Disconnect();
382 expect_device_service_deleted_ = true; 383 expect_device_service_deleted_ = true;
383 384
384 // Wait for message pipe to process error. 385 // Wait for message pipe to process error.
385 base::RunLoop().RunUntilIdle(); 386 base::RunLoop().RunUntilIdle();
386 } 387 }
387 388
388 } // namespace bluetooth 389 } // 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