Update the device plugins supported devices arguments
Summary: Device plugins won't work for DummyDevice type as the device id is a fake one for this. This diff updates the "supportedDevices" for the plugins. Reviewed By: mweststrate Differential Revision: D26944601 fbshipit-source-id: a29acc288f8f0c564f52db02914e7b0491b211d2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
60994bd41f
commit
50f31f9fe0
@@ -11,6 +11,7 @@ import BaseDevice from '../BaseDevice';
|
||||
import * as DeviceTestPluginModule from '../../test-utils/DeviceTestPlugin';
|
||||
import {TestUtils, _SandyPluginDefinition} from 'flipper-plugin';
|
||||
import ArchivedDevice from '../ArchivedDevice';
|
||||
import DummyDevice from '../DummyDevice';
|
||||
|
||||
const physicalDevicePluginDetails = TestUtils.createMockPluginDetails({
|
||||
id: 'physicalDevicePlugin',
|
||||
@@ -103,6 +104,23 @@ const androidEmulatorDevicePlugin = new _SandyPluginDefinition(
|
||||
androidEmulatorlDevicePluginDetails,
|
||||
DeviceTestPluginModule,
|
||||
);
|
||||
|
||||
const androidOnlyDevicePluginDetails = TestUtils.createMockPluginDetails({
|
||||
id: 'androidEmulatorDevicePlugin',
|
||||
name: 'flipper-plugin-android-emulator-device',
|
||||
version: '0.0.1',
|
||||
pluginType: 'device',
|
||||
supportedDevices: [
|
||||
{
|
||||
os: 'Android',
|
||||
},
|
||||
],
|
||||
});
|
||||
const androidOnlyDevicePlugin = new _SandyPluginDefinition(
|
||||
androidOnlyDevicePluginDetails,
|
||||
DeviceTestPluginModule,
|
||||
);
|
||||
|
||||
test('ios physical device compatibility', () => {
|
||||
const device = new BaseDevice('serial', 'physical', 'test device', 'iOS');
|
||||
expect(device.supportsPlugin(physicalDevicePlugin)).toBeTruthy();
|
||||
@@ -150,3 +168,13 @@ test('android KaiOS device compatibility', () => {
|
||||
expect(device.supportsPlugin(androidKaiosPhysicalDevicePlugin)).toBeTruthy();
|
||||
expect(device.supportsPlugin(androidEmulatorDevicePlugin)).toBeFalsy();
|
||||
});
|
||||
|
||||
test('android dummy device compatibility', () => {
|
||||
const device = new DummyDevice('serial', 'test device', 'Android');
|
||||
expect(device.supportsPlugin(physicalDevicePlugin)).toBeFalsy();
|
||||
expect(device.supportsPlugin(iosPhysicalDevicePlugin)).toBeFalsy();
|
||||
expect(device.supportsPlugin(iosEmulatorDevicePlugin)).toBeFalsy();
|
||||
expect(device.supportsPlugin(androidKaiosPhysicalDevicePlugin)).toBeFalsy();
|
||||
expect(device.supportsPlugin(androidEmulatorDevicePlugin)).toBeFalsy();
|
||||
expect(device.supportsPlugin(androidOnlyDevicePlugin)).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"id": "CrashReporter",
|
||||
"pluginType": "device",
|
||||
"supportedDevices": [
|
||||
{"os": "Android"},
|
||||
{"os": "Android", "type": "emulator"},
|
||||
{"os": "Android", "type": "physical"},
|
||||
{"os": "iOS", "type": "emulator"}
|
||||
],
|
||||
"version": "0.0.0",
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
"id": "DeviceLogs",
|
||||
"pluginType": "device",
|
||||
"supportedDevices": [
|
||||
{"os": "Android"},
|
||||
{"os": "Android", "type": "emulator"},
|
||||
{"os": "Android", "type": "physical"},
|
||||
{"os": "iOS", "type": "emulator"},
|
||||
{"os": "Metro"}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user