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

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.h

Issue 2708513002: bluetooth: Post a task when sending GATT events to simulate another thread. (Closed)
Patch Set: Remove unnecessary if statement 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 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 JNIEnv* env, 154 JNIEnv* env,
155 const base::android::JavaParamRef<jobject>& caller, 155 const base::android::JavaParamRef<jobject>& caller,
156 const base::android::JavaParamRef<jbyteArray>& value); 156 const base::android::JavaParamRef<jbyteArray>& value);
157 157
158 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called. 158 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called.
159 void OnFakeAdapterStateChanged( 159 void OnFakeAdapterStateChanged(
160 JNIEnv* env, 160 JNIEnv* env,
161 const base::android::JavaParamRef<jobject>& caller, 161 const base::android::JavaParamRef<jobject>& caller,
162 const bool powered); 162 const bool powered);
163 163
164 // Posts a task to be run on the current message loop.
165 void PostTaskFromJava(JNIEnv* env,
166 const base::android::JavaParamRef<jobject>& caller,
167 const base::android::JavaParamRef<jobject>& runnable);
168
164 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_; 169 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_;
165 170
166 int gatt_open_connections_ = 0; 171 int gatt_open_connections_ = 0;
167 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr; 172 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr;
168 }; 173 };
169 174
170 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). 175 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName).
171 typedef BluetoothTestAndroid BluetoothTest; 176 typedef BluetoothTestAndroid BluetoothTest;
172 177
173 } // namespace device 178 } // namespace device
174 179
175 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ 180 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698