| 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 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "device/bluetooth/test/bluetooth_test.h" | 9 #include "device/bluetooth/test/bluetooth_test.h" |
| 10 | 10 |
| 11 namespace device { | 11 namespace device { |
| 12 | 12 |
| 13 class BluetoothAdapterAndroid; | 13 class BluetoothAdapterAndroid; |
| 14 | 14 |
| 15 // Android implementation of BluetoothTestBase. | 15 // Android implementation of BluetoothTestBase. |
| 16 class BluetoothTestAndroid : public BluetoothTestBase { | 16 class BluetoothTestAndroid : public BluetoothTestBase { |
| 17 public: | 17 public: |
| 18 BluetoothTestAndroid(); | 18 BluetoothTestAndroid(); |
| 19 ~BluetoothTestAndroid() override; | 19 ~BluetoothTestAndroid() override; |
| 20 | 20 |
| 21 // Test overrides: | 21 // Test overrides: |
| 22 void SetUp() override; | 22 void SetUp() override; |
| 23 | 23 |
| 24 // BluetoothTestBase overrides: | 24 // BluetoothTestBase overrides: |
| 25 bool PlatformSupportsLowEnergy() override; | 25 bool PlatformSupportsLowEnergy() override; |
| 26 void InitWithDefaultAdapter() override; | 26 void InitWithDefaultAdapter() override; |
| 27 void InitWithoutDefaultAdapter() override; | 27 void InitWithoutDefaultAdapter() override; |
| 28 void InitWithFakeAdapter() override; | 28 void InitWithFakeAdapter() override; |
| 29 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; | 29 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; |
| 30 void CompleteGattConnection(BluetoothDevice* device) override; | 30 void SimulateGattConnection(BluetoothDevice* device) override; |
| 31 void FailGattConnection(BluetoothDevice* device, | 31 void SimulateGattConnectionError(BluetoothDevice* device, |
| 32 BluetoothDevice::ConnectErrorCode) override; | 32 BluetoothDevice::ConnectErrorCode) override; |
| 33 void CompleteGattDisconnection(BluetoothDevice* device) override; | 33 void SimulateGattDisconnection(BluetoothDevice* device) override; |
| 34 | 34 |
| 35 // Records that Java FakeBluetoothDevice connectGatt was called. | 35 // Records that Java FakeBluetoothDevice connectGatt was called. |
| 36 void OnBluetoothDeviceConnectGattCalled(JNIEnv* env, jobject caller); | 36 void OnFakeBluetoothDeviceConnectGattCalled(JNIEnv* env, jobject caller); |
| 37 | 37 |
| 38 // Records that Java FakeBluetoothGatt disconnect was called. | 38 // Records that Java FakeBluetoothGatt disconnect was called. |
| 39 void OnFakeBluetoothGattDisconnect(JNIEnv* env, jobject caller); | 39 void OnFakeBluetoothGattDisconnect(JNIEnv* env, jobject caller); |
| 40 | 40 |
| 41 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_; | 41 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 44 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
| 45 typedef BluetoothTestAndroid BluetoothTest; | 45 typedef BluetoothTestAndroid BluetoothTest; |
| 46 | 46 |
| 47 } // namespace device | 47 } // namespace device |
| 48 | 48 |
| 49 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 49 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
| OLD | NEW |