Skip to content

Conversation

@cbracken
Copy link
Member

Eliminates the need for the device/daemon code to get at the iOS/Android
tooling indirectly via Doctor. In tests, we now inject the workflow
objects (or mocks) directly.

Eliminates the need for the device/daemon code to get at the iOS/Android
tooling indirectly via Doctor. In tests, we now inject the workflow
objects (or mocks) directly.
@cbracken cbracken requested a review from tvolkert June 15, 2017 22:18
import 'android_sdk.dart';
import 'android_studio.dart' as android_studio;

AndroidWorkflow get androidWorkflow => context[AndroidWorkflow];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will alleviate us from having to aggressively inject it everywhere (like Fuchsia and google-internal)

context.putIfAbsent(AndroidWorkflow, () => new AndroidWorkflow())

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

import '../doctor.dart';
import 'mac.dart';

IOSWorkflow get iosWorkflow => context[IOSWorkflow];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - ... => context.putIfAbsent(...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

class MockAndroidWorkflow extends AndroidWorkflow {
MockAndroidWorkflow({this.canListDevices});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default to true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


class MockIosWorkflow extends IOSWorkflow {
class MockIOSWorkflow extends IOSWorkflow {
MockIOSWorkflow({this.canListDevices});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@tvolkert tvolkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comments

@cbracken cbracken merged commit 615410d into flutter:master Jun 15, 2017
@cbracken cbracken deleted the workflow-inject branch June 15, 2017 23:11
@cbracken
Copy link
Member Author

Prefactoring for #10602, #10633

gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jul 1, 2017
Eliminates the need for the device/daemon code to get at the iOS/Android
tooling indirectly via Doctor. In tests, we now inject the workflow
objects (or mocks) directly.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants