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

Side by Side Diff: device/bluetooth/test/test_bluetooth_adapter_observer.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 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/test/test_bluetooth_adapter_observer.h" 5 #include "device/bluetooth/test/test_bluetooth_adapter_observer.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h"
11 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" 12 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
12 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" 13 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h"
13 #include "device/bluetooth/bluetooth_remote_gatt_service.h" 14 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace device { 17 namespace device {
17 18
18 TestBluetoothAdapterObserver::TestBluetoothAdapterObserver( 19 TestBluetoothAdapterObserver::TestBluetoothAdapterObserver(
19 scoped_refptr<BluetoothAdapter> adapter) 20 scoped_refptr<BluetoothAdapter> adapter)
20 : adapter_(adapter) { 21 : adapter_(adapter) {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 327
327 ASSERT_TRUE(descriptor->GetCharacteristic()); 328 ASSERT_TRUE(descriptor->GetCharacteristic());
328 EXPECT_EQ( 329 EXPECT_EQ(
329 descriptor->GetCharacteristic()->GetDescriptor(last_gatt_descriptor_id_), 330 descriptor->GetCharacteristic()->GetDescriptor(last_gatt_descriptor_id_),
330 descriptor); 331 descriptor);
331 332
332 QuitMessageLoop(); 333 QuitMessageLoop();
333 } 334 }
334 335
335 void TestBluetoothAdapterObserver::QuitMessageLoop() { 336 void TestBluetoothAdapterObserver::QuitMessageLoop() {
336 if (base::MessageLoop::current() && 337 if (base::RunLoop::IsRunningOnCurrentThread())
337 base::MessageLoop::current()->is_running())
338 base::MessageLoop::current()->QuitWhenIdle(); 338 base::MessageLoop::current()->QuitWhenIdle();
339 } 339 }
340 340
341 } // namespace device 341 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_socket_bluez_unittest.cc ('k') | extensions/browser/api/alarms/alarms_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698