Repository: flutter
Issue: Breakpoint doesn't work when running test
Labels: a: tests,tool,dependency: dart,a: debugging,has reproducible steps,P2,found in release: 2.10,found in release: 2.11,team-tool,triaged-tool

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

The break point works fine when you run it normally but fails to stop if running from the unit test and widget test. 

Steps to reproduce:
1. Set break points anywhere in the MyApp or its child class.
2. Set break point in the counterStateProvider
3. Run debug with unit test or widget test
4. break points are skipped, for example
<img width="515" alt="image" src="https://user-images.githubusercontent.com/3827781/153954226-cdd00730-d5c2-461e-a814-a1e220347d5b.png">

Notes:

1. The break points still works on the test files, but not inside the lib folder.
2. If you comment out MockCounterNotifier in all test files and debug again, the break point then works. Really weird.
    <img width="889" alt="image" src="https://user-images.githubusercontent.com/3827781/153954575-419de4d4-df9e-4495-97f9-3dab476567c2.png">
3. Try it on vscode but same result, so might not be an IDE thing.
4. Im on android studio bumblebee
5. macOS on Apple Silicon

A code sample: 
https://github.com/PandaGeek1024/breakpointNotWorking

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.10.1, on macOS 12.2 21D49 darwin-arm, locale en-AU)
    • Flutter version 2.10.1 at /Users/jayhuang/Developer/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db747aa133 (5 days ago), 2022-02-09 13:57:35 -0600
    • Engine revision ab46186b24
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/jayhuang/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (2 available)
    • iPhone 13 Pro Max (mobile) • 7FC8131C-6F67-4DDE-B3C7-A18B0A503CCC • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->