Skip to content

Remove mocks from web devices test #77968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 11, 2021

Remove mocks from web devices_test.dart and a few other unrelated unused Mock classes.

Delete Edge device is not listed when Edge cannot be run.

  1. This wasn't testing any Edge device case because the test platform was Linux. So the test was passing because _edgeDevice was always null, not because an executable was unrunnable.
  2. When I tried to fix the test, there's nothing related to Edge devices not being found due to some executable being unrunnable. I fixed the test to find Edge devices, and it never calls canRun anywhere. It only does a version check to decide whether to show the Edge device, which is covered in another test
    if (await _edgeDevice?._meetsVersionConstraint() ?? false)
    _edgeDevice,

    Future<bool> _meetsVersionConstraint() async {
    final String rawVersion = (await sdkNameAndVersion).replaceFirst('Microsoft Edge ', '');
    final Version version = Version.parse(rawVersion);
    if (version == null) {
    return false;
    }
    return version.major >= _kFirstChromiumEdgeMajorVersion;
    }

Part of #71511

@jmagman jmagman added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Mar 11, 2021
@jmagman jmagman self-assigned this Mar 11, 2021
@google-cla google-cla bot added the cla: yes label Mar 11, 2021
@jmagman jmagman requested a review from jonahwilliams March 12, 2021 01:23
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM!

@fluttergithubbot fluttergithubbot merged commit 66768f8 into flutter:master Mar 12, 2021
@jmagman jmagman deleted the web-devices-mock branch March 12, 2021 17:49
@jmagman jmagman added the c: tech-debt Technical debt, code quality, testing, etc. label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. c: tech-debt Technical debt, code quality, testing, etc. 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