Use TestDevice from flipper-frontend-core in flipper-ui-core
Summary: See D37139129 Reviewed By: lblasa Differential Revision: D37235567 fbshipit-source-id: a0596ba71fcb8722088e51361774389a7daaebb8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a648861273
commit
fab8849c73
@@ -16,6 +16,7 @@ export {
|
||||
} from './AbstractClient';
|
||||
export {default as ArchivedDevice} from './devices/ArchivedDevice';
|
||||
export {default as BaseDevice, DeviceExport} from './devices/BaseDevice';
|
||||
export {TestDevice} from './devices/TestDevice';
|
||||
export * from './globalObject';
|
||||
export * from './plugins';
|
||||
export {getPluginKey} from './utils/pluginKey';
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
PluginClient,
|
||||
} from 'flipper-plugin';
|
||||
import {handleClientConnected} from '../dispatcher/flipperServer';
|
||||
import {TestDevice} from '../devices/TestDevice';
|
||||
import {TestDevice} from 'flipper-frontend-core';
|
||||
|
||||
test('Devices can disconnect', async () => {
|
||||
const deviceplugin = new _SandyPluginDefinition(
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import {createStore} from 'redux';
|
||||
import {BaseDevice} from 'flipper-frontend-core';
|
||||
import {BaseDevice, TestDevice} from 'flipper-frontend-core';
|
||||
import {createRootReducer} from '../../reducers';
|
||||
import {Store} from '../../reducers/index';
|
||||
import Client from '../../Client';
|
||||
@@ -26,7 +26,6 @@ import {initializeFlipperLibImplementation} from '../../utils/flipperLibImplemen
|
||||
import pluginManager from '../../dispatcher/pluginManager';
|
||||
import {PluginDetails} from 'flipper-common';
|
||||
import {ClientQuery, DeviceOS} from 'flipper-common';
|
||||
import {TestDevice} from '../../devices/TestDevice';
|
||||
import {getRenderHostInstance} from '../../RenderHost';
|
||||
|
||||
export interface AppOptions {
|
||||
|
||||
@@ -31,7 +31,7 @@ export {getPluginKey} from './utils/pluginKey';
|
||||
export {Notification, Idler} from 'flipper-plugin';
|
||||
export {IdlerImpl} from './utils/Idler';
|
||||
export {Store, State as ReduxState} from './reducers/index';
|
||||
export {BaseDevice, ArchivedDevice} from 'flipper-frontend-core';
|
||||
export {BaseDevice, ArchivedDevice, TestDevice} from 'flipper-frontend-core';
|
||||
export {default as isProduction} from './utils/isProduction';
|
||||
export {DetailSidebar} from 'flipper-plugin';
|
||||
export {BaseDevice as Device} from 'flipper-frontend-core';
|
||||
@@ -120,5 +120,4 @@ export {callVSCode} from './utils/vscodeUtils';
|
||||
export {IDEFileResolver, IDEType} from './fb-stubs/IDEFileResolver';
|
||||
export {Tracked} from 'flipper-plugin'; // To be able to use it in legacy plugins
|
||||
export {RequireLogin} from './ui/components/RequireLogin';
|
||||
export {TestDevice} from './devices/TestDevice';
|
||||
export {connect} from 'react-redux';
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {DeviceOS, DeviceType} from 'flipper-plugin';
|
||||
import {DeviceSpec} from 'flipper-common';
|
||||
import {BaseDevice} from 'flipper-frontend-core';
|
||||
import {getRenderHostInstance} from '../RenderHost';
|
||||
|
||||
export class TestDevice extends BaseDevice {
|
||||
constructor(
|
||||
serial: string,
|
||||
deviceType: DeviceType,
|
||||
title: string,
|
||||
os: DeviceOS,
|
||||
specs?: DeviceSpec[],
|
||||
) {
|
||||
super(getRenderHostInstance().flipperServer, {
|
||||
serial,
|
||||
deviceType,
|
||||
title,
|
||||
os,
|
||||
specs,
|
||||
features: {
|
||||
screenCaptureAvailable: false,
|
||||
screenshotAvailable: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async startLogging() {
|
||||
// noop
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,7 @@
|
||||
import * as DeviceTestPluginModule from '../../__tests__/test-utils/DeviceTestPlugin';
|
||||
import {TestUtils, _SandyPluginDefinition} from 'flipper-plugin';
|
||||
import {createMockFlipperWithPlugin} from '../../__tests__/test-utils/createMockFlipperWithPlugin';
|
||||
import {TestDevice} from '../../devices/TestDevice';
|
||||
import {ArchivedDevice} from 'flipper-frontend-core';
|
||||
import {ArchivedDevice, TestDevice} from 'flipper-frontend-core';
|
||||
|
||||
const physicalDevicePluginDetails = TestUtils.createMockPluginDetails({
|
||||
id: 'physicalDevicePlugin',
|
||||
|
||||
@@ -14,14 +14,13 @@ import {
|
||||
_setFlipperLibImplementation,
|
||||
TestUtils,
|
||||
} from 'flipper-plugin';
|
||||
import {TestDevice} from '../../devices/TestDevice';
|
||||
import {
|
||||
createMockFlipperWithPlugin,
|
||||
MockFlipperResult,
|
||||
} from '../../__tests__/test-utils/createMockFlipperWithPlugin';
|
||||
import {Store} from '..';
|
||||
import {getActiveClient, getActiveDevice} from '../../selectors/connections';
|
||||
import {BaseDevice} from 'flipper-frontend-core';
|
||||
import {BaseDevice, TestDevice} from 'flipper-frontend-core';
|
||||
import Client from '../../Client';
|
||||
import {
|
||||
mockConsole,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
MockFlipperResult,
|
||||
} from '../../../__tests__/test-utils/createMockFlipperWithPlugin';
|
||||
import {FlipperPlugin} from '../../../plugin';
|
||||
import {BaseDevice} from 'flipper-frontend-core';
|
||||
import {BaseDevice, TestDevice} from 'flipper-frontend-core';
|
||||
import {_SandyPluginDefinition} from 'flipper-plugin';
|
||||
import {TestUtils} from 'flipper-plugin';
|
||||
import {selectPlugin} from '../../../reducers/connections';
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
getMetroDevice,
|
||||
getPluginLists,
|
||||
} from '../../../selectors/connections';
|
||||
import {TestDevice} from '../../../devices/TestDevice';
|
||||
|
||||
const createMockPluginDetails = TestUtils.createMockPluginDetails;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import {State} from '../../reducers/index';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import {ArchivedDevice} from 'flipper-frontend-core';
|
||||
import {ArchivedDevice, TestDevice} from 'flipper-frontend-core';
|
||||
import {
|
||||
processStore,
|
||||
determinePluginsToProcess,
|
||||
@@ -37,7 +37,6 @@ import {
|
||||
} from 'flipper-plugin';
|
||||
import {selectPlugin, getAllClients} from '../../reducers/connections';
|
||||
import {TestIdler} from '../Idler';
|
||||
import {TestDevice} from '../../devices/TestDevice';
|
||||
import {FlipperServer} from 'flipper-common';
|
||||
|
||||
const testIdler = new TestIdler();
|
||||
|
||||
Reference in New Issue
Block a user