Skip to content

[flutter_tools] remove globals from desktop configuration - #67146

Merged
jonahwilliams merged 6 commits into
flutter:masterfrom
jonahwilliams:engine_switches
Oct 3, 2020
Merged

jonahwilliams merged 6 commits into
flutter:masterfrom
jonahwilliams:engine_switches

Conversation

@jonahwilliams

@jonahwilliams jonahwilliams commented Oct 2, 2020 •

Copy link
Copy Markdown
Contributor

Description

Refactors the desktop devices and workflow to remove unnecessary usage of global variables. This should make it easier to test and continue enhancing the desktop functionality of the tooling

#47161

@flutter-dashboard flutter-dashboard Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 2, 2020
ProtocolDiscovery observatoryDiscovery;

if (debuggingOptions.debuggingEnabled) {
// TODO(devoncarew): Remember the forwarding information (so we can later remove the

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This has since been done

@jonahwilliams

Copy link
Copy Markdown
Contributor Author

This will take a g3fix to land for real

void onAttached(ApplicationPackage package, BuildMode buildMode, Process process) {}
}

/// A log reader for desktop applications.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried :)

).devices, <Device>[]);
});

testWithoutContext('WindowsDevices lists a devices if the workflow is supported ', () async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
testWithoutContext('WindowsDevices lists a devices if the workflow is supported ', () async {
testWithoutContext('WindowsDevices lists a devices if the workflow is supported', () async {

Platform: () => windows,
FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: true),
},
final FakePlatform windows = FakePlatform(operatingSystem: 'windows');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And we can safely assume these never get mutated, leaking state between tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are some contrived circumstances where you can mutate the environment field, but only if that is set to a non-const value (it defaults to an empty const map, which is unmodifiable)

@christopherfujino christopherfujino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with a few nits

@jonahwilliams
jonahwilliams merged commit ddb8177 into flutter:master Oct 3, 2020
@jonahwilliams
jonahwilliams deleted the engine_switches branch October 3, 2020 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants