[Driver] correct type for getWidgetDiagnostics (#45985)

This commit is contained in:
Jacek Marchwicki
2019-12-04 05:33:02 +01:00
committed by Flutter GitHub Bot
parent 4484ae4043
commit 50532f387a
2 changed files with 37 additions and 1 deletions

View File

@@ -619,7 +619,7 @@ class FlutterDriver {
}) async {
return _sendCommand(GetDiagnosticsTree(
finder,
DiagnosticsType.renderObject,
DiagnosticsType.widget,
subtreeDepth: subtreeDepth,
includeProperties: includeProperties,
timeout: timeout,

View File

@@ -250,6 +250,42 @@ void main() {
});
});
group('getWidgetDiagnostics', () {
test('sends the getWidgetDiagnostics command', () async {
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{
'command': 'get_diagnostics_tree',
'diagnosticsType': 'widget',
'finderType': 'ByTooltipMessage',
'text': 'foo',
'includeProperties': 'true',
'subtreeDepth': '0',
'timeout': _kSerializedTestTimeout,
});
return makeMockResponse(<String, dynamic>{});
});
await driver.getWidgetDiagnostics(find.byTooltip('foo'), timeout: _kTestTimeout);
});
});
group('getRenderObjectDiagnostics', () {
test('sends the getRenderObjectDiagnostics command', () async {
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{
'command': 'get_diagnostics_tree',
'diagnosticsType': 'renderObject',
'finderType': 'ByTooltipMessage',
'text': 'foo',
'includeProperties': 'true',
'subtreeDepth': '0',
'timeout': _kSerializedTestTimeout,
});
return makeMockResponse(<String, dynamic>{});
});
await driver.getRenderObjectDiagnostics(find.byTooltip('foo'), timeout: _kTestTimeout);
});
});
group('waitForCondition', () {
test('sends the wait for NoPendingFrameCondition command', () async {
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {