| OLD | NEW |
| 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/bluetooth_test_android.h" | 5 #include "device/bluetooth/test/bluetooth_test_android.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Register in SetUp so that ASSERT can be used. | 35 // Register in SetUp so that ASSERT can be used. |
| 36 ASSERT_TRUE(RegisterNativesImpl(AttachCurrentThread())); | 36 ASSERT_TRUE(RegisterNativesImpl(AttachCurrentThread())); |
| 37 | 37 |
| 38 // Set the permission to true so that we can use the API. | 38 // Set the permission to true so that we can use the API. |
| 39 Java_Fakes_setLocationServicesState( | 39 Java_Fakes_setLocationServicesState( |
| 40 AttachCurrentThread(), true /* hasPermission */, true /* isEnabled */); | 40 AttachCurrentThread(), true /* hasPermission */, true /* isEnabled */); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void BluetoothTestAndroid::TearDown() { | 43 void BluetoothTestAndroid::TearDown() { |
| 44 BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); | 44 BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
| 45 for (auto& device : devices) { | 45 for (auto* device : devices) { |
| 46 DeleteDevice(device); | 46 DeleteDevice(device); |
| 47 } | 47 } |
| 48 EXPECT_EQ(0, gatt_open_connections_); | 48 EXPECT_EQ(0, gatt_open_connections_); |
| 49 BluetoothTestBase::TearDown(); | 49 BluetoothTestBase::TearDown(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool BluetoothTestAndroid::PlatformSupportsLowEnergy() { | 52 bool BluetoothTestAndroid::PlatformSupportsLowEnergy() { |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 } | 477 } |
| 478 | 478 |
| 479 void BluetoothTestAndroid::OnFakeAdapterStateChanged( | 479 void BluetoothTestAndroid::OnFakeAdapterStateChanged( |
| 480 JNIEnv* env, | 480 JNIEnv* env, |
| 481 const JavaParamRef<jobject>& caller, | 481 const JavaParamRef<jobject>& caller, |
| 482 const bool powered) { | 482 const bool powered) { |
| 483 adapter_->NotifyAdapterPoweredChanged(powered); | 483 adapter_->NotifyAdapterPoweredChanged(powered); |
| 484 } | 484 } |
| 485 | 485 |
| 486 } // namespace device | 486 } // namespace device |
| OLD | NEW |