blob: 22d50f9c86d4090552a6f07ca4971c2974358070 [file] [log] [blame]
Steven Morelandd44007e2019-10-24 18:12:46 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include <aidl/Gtest.h>
17#include <aidl/Vintf.h>
18
19#include <android/hardware/vibrator/BnVibratorCallback.h>
20#include <android/hardware/vibrator/IVibrator.h>
21#include <binder/IServiceManager.h>
22#include <binder/ProcessState.h>
23
24#include <future>
25
26using android::ProcessState;
27using android::sp;
28using android::String16;
29using android::binder::Status;
30using android::hardware::vibrator::BnVibratorCallback;
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +090031using android::hardware::vibrator::CompositeEffect;
32using android::hardware::vibrator::CompositePrimitive;
Steven Morelandd44007e2019-10-24 18:12:46 -070033using android::hardware::vibrator::Effect;
34using android::hardware::vibrator::EffectStrength;
35using android::hardware::vibrator::IVibrator;
Harpreet \"Eli\" Sanghab075a6a2020-04-10 15:11:58 +090036using std::chrono::high_resolution_clock;
Steven Morelandd44007e2019-10-24 18:12:46 -070037
Jooyung Han716648d2019-12-17 14:17:48 +000038const std::vector<Effect> kEffects{android::enum_range<Effect>().begin(),
39 android::enum_range<Effect>().end()};
40const std::vector<EffectStrength> kEffectStrengths{android::enum_range<EffectStrength>().begin(),
41 android::enum_range<EffectStrength>().end()};
Steven Morelandd44007e2019-10-24 18:12:46 -070042
43const std::vector<Effect> kInvalidEffects = {
Steven Morelandf3353882019-11-07 17:02:43 -080044 static_cast<Effect>(static_cast<int32_t>(kEffects.front()) - 1),
45 static_cast<Effect>(static_cast<int32_t>(kEffects.back()) + 1),
Steven Morelandd44007e2019-10-24 18:12:46 -070046};
47
48const std::vector<EffectStrength> kInvalidEffectStrengths = {
Steven Morelandf3353882019-11-07 17:02:43 -080049 static_cast<EffectStrength>(static_cast<int8_t>(kEffectStrengths.front()) - 1),
50 static_cast<EffectStrength>(static_cast<int8_t>(kEffectStrengths.back()) + 1),
Steven Morelandd44007e2019-10-24 18:12:46 -070051};
52
Steven Moreland1c269782020-01-09 11:16:05 -080053const std::vector<CompositePrimitive> kCompositePrimitives{
54 android::enum_range<CompositePrimitive>().begin(),
55 android::enum_range<CompositePrimitive>().end()};
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +090056
57const std::vector<CompositePrimitive> kInvalidPrimitives = {
58 static_cast<CompositePrimitive>(static_cast<int32_t>(kCompositePrimitives.front()) - 1),
59 static_cast<CompositePrimitive>(static_cast<int32_t>(kCompositePrimitives.back()) + 1),
60};
61
Steven Morelandd44007e2019-10-24 18:12:46 -070062class CompletionCallback : public BnVibratorCallback {
63 public:
64 CompletionCallback(const std::function<void()>& callback) : mCallback(callback) {}
65 Status onComplete() override {
66 mCallback();
67 return Status::ok();
68 }
69
70 private:
71 std::function<void()> mCallback;
72};
73
74class VibratorAidl : public testing::TestWithParam<std::string> {
75 public:
76 virtual void SetUp() override {
77 vibrator = android::waitForDeclaredService<IVibrator>(String16(GetParam().c_str()));
78 ASSERT_NE(vibrator, nullptr);
79 ASSERT_TRUE(vibrator->getCapabilities(&capabilities).isOk());
80 }
81
82 sp<IVibrator> vibrator;
83 int32_t capabilities;
84};
85
86TEST_P(VibratorAidl, OnThenOffBeforeTimeout) {
87 EXPECT_TRUE(vibrator->on(2000, nullptr /*callback*/).isOk());
88 sleep(1);
89 EXPECT_TRUE(vibrator->off().isOk());
90}
91
92TEST_P(VibratorAidl, OnWithCallback) {
93 if (!(capabilities & IVibrator::CAP_PERFORM_CALLBACK)) return;
94
95 std::promise<void> completionPromise;
96 std::future<void> completionFuture{completionPromise.get_future()};
97 sp<CompletionCallback> callback =
98 new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
99 uint32_t durationMs = 250;
100 std::chrono::milliseconds timeout{durationMs * 2};
101 EXPECT_TRUE(vibrator->on(durationMs, callback).isOk());
102 EXPECT_EQ(completionFuture.wait_for(timeout), std::future_status::ready);
103 EXPECT_TRUE(vibrator->off().isOk());
104}
105
106TEST_P(VibratorAidl, OnCallbackNotSupported) {
107 if (!(capabilities & IVibrator::CAP_PERFORM_CALLBACK)) {
108 sp<CompletionCallback> callback = new CompletionCallback([] {});
109 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION, vibrator->on(250, callback).exceptionCode());
110 }
111}
112
113TEST_P(VibratorAidl, ValidateEffect) {
Steven Moreland2932b222019-11-05 14:30:17 -0800114 std::vector<Effect> supported;
115 ASSERT_TRUE(vibrator->getSupportedEffects(&supported).isOk());
116
Steven Morelandd44007e2019-10-24 18:12:46 -0700117 for (Effect effect : kEffects) {
Steven Moreland2932b222019-11-05 14:30:17 -0800118 bool isEffectSupported =
119 std::find(supported.begin(), supported.end(), effect) != supported.end();
120
Steven Morelandd44007e2019-10-24 18:12:46 -0700121 for (EffectStrength strength : kEffectStrengths) {
122 int32_t lengthMs = 0;
123 Status status = vibrator->perform(effect, strength, nullptr /*callback*/, &lengthMs);
Steven Moreland2932b222019-11-05 14:30:17 -0800124
125 if (isEffectSupported) {
Harpreet \"Eli\" Sanghae1723a42019-12-06 14:09:33 +0900126 EXPECT_TRUE(status.isOk()) << toString(effect) << " " << toString(strength);
Steven Morelandd44007e2019-10-24 18:12:46 -0700127 EXPECT_GT(lengthMs, 0);
Steven Morelandf3353882019-11-07 17:02:43 -0800128 usleep(lengthMs * 1000);
Steven Morelandd44007e2019-10-24 18:12:46 -0700129 } else {
Steven Morelandf3353882019-11-07 17:02:43 -0800130 EXPECT_EQ(status.exceptionCode(), Status::EX_UNSUPPORTED_OPERATION)
Harpreet \"Eli\" Sanghae1723a42019-12-06 14:09:33 +0900131 << toString(effect) << " " << toString(strength);
Steven Morelandd44007e2019-10-24 18:12:46 -0700132 EXPECT_EQ(lengthMs, 0);
133 }
134 }
135 }
136}
137
138TEST_P(VibratorAidl, ValidateEffectWithCallback) {
139 if (!(capabilities & IVibrator::CAP_PERFORM_CALLBACK)) return;
140
Steven Moreland2932b222019-11-05 14:30:17 -0800141 std::vector<Effect> supported;
142 ASSERT_TRUE(vibrator->getSupportedEffects(&supported).isOk());
143
Steven Morelandd44007e2019-10-24 18:12:46 -0700144 for (Effect effect : kEffects) {
Steven Moreland2932b222019-11-05 14:30:17 -0800145 bool isEffectSupported =
146 std::find(supported.begin(), supported.end(), effect) != supported.end();
147
Steven Morelandd44007e2019-10-24 18:12:46 -0700148 for (EffectStrength strength : kEffectStrengths) {
149 std::promise<void> completionPromise;
150 std::future<void> completionFuture{completionPromise.get_future()};
151 sp<CompletionCallback> callback =
152 new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
Steven Moreland2932b222019-11-05 14:30:17 -0800153 int lengthMs = 0;
Steven Morelandd44007e2019-10-24 18:12:46 -0700154 Status status = vibrator->perform(effect, strength, callback, &lengthMs);
Steven Moreland2932b222019-11-05 14:30:17 -0800155
156 if (isEffectSupported) {
157 EXPECT_TRUE(status.isOk());
158 EXPECT_GT(lengthMs, 0);
159 } else {
160 EXPECT_EQ(status.exceptionCode(), Status::EX_UNSUPPORTED_OPERATION);
161 EXPECT_EQ(lengthMs, 0);
162 }
163
Steven Morelandd44007e2019-10-24 18:12:46 -0700164 if (!status.isOk()) continue;
165
166 std::chrono::milliseconds timeout{lengthMs * 2};
167 EXPECT_EQ(completionFuture.wait_for(timeout), std::future_status::ready);
168 }
169 }
170}
171
172TEST_P(VibratorAidl, ValidateEffectWithCallbackNotSupported) {
173 if (capabilities & IVibrator::CAP_PERFORM_CALLBACK) return;
174
175 for (Effect effect : kEffects) {
176 for (EffectStrength strength : kEffectStrengths) {
177 sp<CompletionCallback> callback = new CompletionCallback([] {});
178 int lengthMs;
179 Status status = vibrator->perform(effect, strength, callback, &lengthMs);
180 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION, status.exceptionCode());
181 EXPECT_EQ(lengthMs, 0);
182 }
183 }
184}
185
186TEST_P(VibratorAidl, InvalidEffectsUnsupported) {
187 for (Effect effect : kInvalidEffects) {
Steven Morelandf3353882019-11-07 17:02:43 -0800188 for (EffectStrength strength : kEffectStrengths) {
189 int32_t lengthMs;
190 Status status = vibrator->perform(effect, strength, nullptr /*callback*/, &lengthMs);
191 EXPECT_EQ(status.exceptionCode(), Status::EX_UNSUPPORTED_OPERATION)
Harpreet \"Eli\" Sanghae1723a42019-12-06 14:09:33 +0900192 << toString(effect) << " " << toString(strength);
Steven Morelandf3353882019-11-07 17:02:43 -0800193 }
194 }
195 for (Effect effect : kEffects) {
Steven Morelandd44007e2019-10-24 18:12:46 -0700196 for (EffectStrength strength : kInvalidEffectStrengths) {
197 int32_t lengthMs;
198 Status status = vibrator->perform(effect, strength, nullptr /*callback*/, &lengthMs);
Steven Morelandf3353882019-11-07 17:02:43 -0800199 EXPECT_EQ(status.exceptionCode(), Status::EX_UNSUPPORTED_OPERATION)
Harpreet \"Eli\" Sanghae1723a42019-12-06 14:09:33 +0900200 << toString(effect) << " " << toString(strength);
Steven Morelandd44007e2019-10-24 18:12:46 -0700201 }
202 }
203}
204
205TEST_P(VibratorAidl, ChangeVibrationAmplitude) {
206 if (capabilities & IVibrator::CAP_AMPLITUDE_CONTROL) {
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900207 EXPECT_EQ(Status::EX_NONE, vibrator->setAmplitude(0.1f).exceptionCode());
Steven Morelandd44007e2019-10-24 18:12:46 -0700208 EXPECT_TRUE(vibrator->on(2000, nullptr /*callback*/).isOk());
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900209 EXPECT_EQ(Status::EX_NONE, vibrator->setAmplitude(0.5f).exceptionCode());
Steven Morelandd44007e2019-10-24 18:12:46 -0700210 sleep(1);
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900211 EXPECT_EQ(Status::EX_NONE, vibrator->setAmplitude(1.0f).exceptionCode());
Steven Morelandd44007e2019-10-24 18:12:46 -0700212 sleep(1);
213 }
214}
215
216TEST_P(VibratorAidl, AmplitudeOutsideRangeFails) {
217 if (capabilities & IVibrator::CAP_AMPLITUDE_CONTROL) {
218 EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->setAmplitude(-1).exceptionCode());
219 EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->setAmplitude(0).exceptionCode());
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900220 EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->setAmplitude(1.1).exceptionCode());
Steven Morelandd44007e2019-10-24 18:12:46 -0700221 }
222}
223
224TEST_P(VibratorAidl, AmplitudeReturnsUnsupportedMatchingCapabilities) {
225 if ((capabilities & IVibrator::CAP_AMPLITUDE_CONTROL) == 0) {
226 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION, vibrator->setAmplitude(1).exceptionCode());
227 }
228}
229
230TEST_P(VibratorAidl, ChangeVibrationExternalControl) {
231 if (capabilities & IVibrator::CAP_EXTERNAL_CONTROL) {
232 EXPECT_TRUE(vibrator->setExternalControl(true).isOk());
233 sleep(1);
234 EXPECT_TRUE(vibrator->setExternalControl(false).isOk());
235 sleep(1);
236 }
237}
238
Steven Morelandc0b92d52019-11-05 13:31:41 -0800239TEST_P(VibratorAidl, ExternalAmplitudeControl) {
240 const bool supportsExternalAmplitudeControl =
241 (capabilities & IVibrator::CAP_EXTERNAL_AMPLITUDE_CONTROL) > 0;
242
243 if (capabilities & IVibrator::CAP_EXTERNAL_CONTROL) {
244 EXPECT_TRUE(vibrator->setExternalControl(true).isOk());
245
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900246 Status amplitudeStatus = vibrator->setAmplitude(0.5);
Steven Morelandc0b92d52019-11-05 13:31:41 -0800247 if (supportsExternalAmplitudeControl) {
248 EXPECT_TRUE(amplitudeStatus.isOk());
249 } else {
250 EXPECT_EQ(amplitudeStatus.exceptionCode(), Status::EX_UNSUPPORTED_OPERATION);
251 }
252 EXPECT_TRUE(vibrator->setExternalControl(false).isOk());
253 } else {
254 EXPECT_FALSE(supportsExternalAmplitudeControl);
255 }
256}
257
Steven Morelandd44007e2019-10-24 18:12:46 -0700258TEST_P(VibratorAidl, ExternalControlUnsupportedMatchingCapabilities) {
259 if ((capabilities & IVibrator::CAP_EXTERNAL_CONTROL) == 0) {
260 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION,
261 vibrator->setExternalControl(true).exceptionCode());
262 }
263}
264
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900265TEST_P(VibratorAidl, GetSupportedPrimitives) {
266 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
267 std::vector<CompositePrimitive> supported;
268
269 EXPECT_EQ(Status::EX_NONE, vibrator->getSupportedPrimitives(&supported).exceptionCode());
270
271 std::sort(supported.begin(), supported.end());
272
273 EXPECT_EQ(kCompositePrimitives, supported);
274 }
275}
276
277TEST_P(VibratorAidl, GetPrimitiveDuration) {
278 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
279 int32_t duration;
280
281 for (auto primitive : kCompositePrimitives) {
282 EXPECT_EQ(Status::EX_NONE,
283 vibrator->getPrimitiveDuration(primitive, &duration).exceptionCode());
284 }
285 }
286}
287
Harpreet \"Eli\" Sanghaf4de5b02019-10-23 09:25:52 +0900288TEST_P(VibratorAidl, ComposeValidPrimitives) {
289 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
290 int32_t maxDelay, maxSize;
291
292 EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
293 EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
294
295 std::vector<CompositeEffect> composite;
296
297 for (auto primitive : kCompositePrimitives) {
298 CompositeEffect effect;
299
300 effect.delayMs = std::rand() % (maxDelay + 1);
301 effect.primitive = primitive;
302 effect.scale = static_cast<float>(std::rand()) / RAND_MAX ?: 1.0f;
303 composite.emplace_back(effect);
304
305 if (composite.size() == maxSize) {
306 EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
307 composite.clear();
308 vibrator->off();
309 }
310 }
311
312 if (composite.size() != 0) {
313 EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
314 vibrator->off();
315 }
316 }
317}
318
319TEST_P(VibratorAidl, ComposeUnsupportedPrimitives) {
320 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
321 for (auto primitive : kInvalidPrimitives) {
322 std::vector<CompositeEffect> composite(1);
323
324 for (auto& effect : composite) {
325 effect.delayMs = 0;
326 effect.primitive = primitive;
327 effect.scale = 1.0f;
328 }
329 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION,
330 vibrator->compose(composite, nullptr).exceptionCode());
331 vibrator->off();
332 }
333 }
334}
335
336TEST_P(VibratorAidl, CompseDelayBoundary) {
337 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
338 int32_t maxDelay;
339
340 EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
341
342 std::vector<CompositeEffect> composite(1);
343 CompositeEffect effect;
344
345 effect.delayMs = 1;
346 effect.primitive = CompositePrimitive::CLICK;
347 effect.scale = 1.0f;
348
349 std::fill(composite.begin(), composite.end(), effect);
350 EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
351
352 effect.delayMs = maxDelay + 1;
353
354 std::fill(composite.begin(), composite.end(), effect);
355 EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
356 vibrator->compose(composite, nullptr).exceptionCode());
357 vibrator->off();
358 }
359}
360
361TEST_P(VibratorAidl, CompseSizeBoundary) {
362 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
363 int32_t maxSize;
364
365 EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
366
367 std::vector<CompositeEffect> composite(maxSize);
368 CompositeEffect effect;
369
370 effect.delayMs = 1;
371 effect.primitive = CompositePrimitive::CLICK;
372 effect.scale = 1.0f;
373
374 std::fill(composite.begin(), composite.end(), effect);
375 EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
376
377 composite.emplace_back(effect);
378 EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
379 vibrator->compose(composite, nullptr).exceptionCode());
380 vibrator->off();
381 }
382}
383
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900384TEST_P(VibratorAidl, ComposeCallback) {
Harpreet \"Eli\" Sanghab075a6a2020-04-10 15:11:58 +0900385 constexpr std::chrono::milliseconds allowedLatency{10};
386
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900387 if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
Harpreet \"Eli\" Sanghab075a6a2020-04-10 15:11:58 +0900388 std::vector<CompositePrimitive> supported;
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900389
Harpreet \"Eli\" Sanghab075a6a2020-04-10 15:11:58 +0900390 ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900391
Harpreet \"Eli\" Sanghab075a6a2020-04-10 15:11:58 +0900392 for (auto primitive : supported) {
393 if (primitive == CompositePrimitive::NOOP) {
394 continue;
395 }
396
397 std::promise<void> completionPromise;
398 std::future<void> completionFuture{completionPromise.get_future()};
399 sp<CompletionCallback> callback =
400 new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
401 CompositeEffect effect;
402 std::vector<CompositeEffect> composite;
403 int32_t durationMs;
404 std::chrono::milliseconds duration;
405 std::chrono::time_point<high_resolution_clock> start, end;
406 std::chrono::milliseconds elapsed;
407
408 effect.delayMs = 0;
409 effect.primitive = primitive;
410 effect.scale = 1.0f;
411 composite.emplace_back(effect);
412
413 EXPECT_EQ(Status::EX_NONE,
414 vibrator->getPrimitiveDuration(primitive, &durationMs).exceptionCode())
415 << toString(primitive);
416 duration = std::chrono::milliseconds(durationMs);
417
418 EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode())
419 << toString(primitive);
420 start = high_resolution_clock::now();
421
422 EXPECT_EQ(completionFuture.wait_for(duration + allowedLatency),
423 std::future_status::ready)
424 << toString(primitive);
425 end = high_resolution_clock::now();
426
427 elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
428 EXPECT_LE(elapsed.count(), (duration + allowedLatency).count()) << toString(primitive);
429 EXPECT_GE(elapsed.count(), (duration - allowedLatency).count()) << toString(primitive);
430 }
Harpreet \"Eli\" Sangha523e2962020-01-21 16:15:42 +0900431 }
432}
433
Harpreet \"Eli\" Sangha63624092019-09-09 11:04:54 +0900434TEST_P(VibratorAidl, AlwaysOn) {
435 if (capabilities & IVibrator::CAP_ALWAYS_ON_CONTROL) {
436 std::vector<Effect> supported;
437 ASSERT_TRUE(vibrator->getSupportedAlwaysOnEffects(&supported).isOk());
438
439 for (Effect effect : kEffects) {
440 bool isEffectSupported =
441 std::find(supported.begin(), supported.end(), effect) != supported.end();
442
443 for (EffectStrength strength : kEffectStrengths) {
444 Status status = vibrator->alwaysOnEnable(0, effect, strength);
445
446 if (isEffectSupported) {
447 EXPECT_EQ(Status::EX_NONE, status.exceptionCode())
448 << toString(effect) << " " << toString(strength);
449 } else {
450 EXPECT_EQ(Status::EX_UNSUPPORTED_OPERATION, status.exceptionCode())
451 << toString(effect) << " " << toString(strength);
452 }
453 }
454 }
455
456 EXPECT_EQ(Status::EX_NONE, vibrator->alwaysOnDisable(0).exceptionCode());
457 }
458}
459
Dan Shiba4d5322020-07-28 13:09:30 -0700460GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VibratorAidl);
Haibo Huang83b4c1e2019-11-08 11:59:40 -0800461INSTANTIATE_TEST_SUITE_P(Vibrator, VibratorAidl,
Steven Morelandd44007e2019-10-24 18:12:46 -0700462 testing::ValuesIn(android::getAidlHalInstanceNames(IVibrator::descriptor)),
463 android::PrintInstanceNameToString);
464
465int main(int argc, char** argv) {
466 ::testing::InitGoogleTest(&argc, argv);
467 ProcessState::self()->setThreadPoolMaxThreadCount(1);
468 ProcessState::self()->startThreadPool();
469 return RUN_ALL_TESTS();
470}