Repository: flutter
Issue: Running a test using @TestOn('browser') annotation shows `no tests were found` result
Labels: a: tests,tool,framework,d: api docs,platform-web,P3,team-web,triaged-web

## Steps to Reproduce
```
@TestOn('browser')
import 'package:flutter_test/flutter_test.dart';

void main() {
  test('I must failed', () async {
    expect(1, 2);
  });
}
```

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

I'm expecting the code to failed....but for some reason, when using the @TestOn('browser') it didn't.
The above code return passed !!!!!!!

**_flutter-doctor_**
```
[√] Flutter (Channel beta, 1.22.0-12.1.pre, on Microsoft Windows [version 10.0.18363.1016], locale fr-CA)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.49.0)
[√] Connected device (4 available)
```


<details>
<summary>log</summary>

```
[  +97 ms] executing: [C:\dev\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +57 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 8b3760638a189741cd9ca881aa2dd237c1df1be5
[        ] executing: [C:\dev\flutter/] git tag --points-at HEAD
[  +49 ms] Exit code 0 from: git tag --points-at HEAD
[        ] 1.22.0-12.1.pre
[  +11 ms] executing: [C:\dev\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +45 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [C:\dev\flutter/] git ls-remote --get-url origin
[  +39 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +62 ms] executing: [C:\dev\flutter/] git rev-parse --abbrev-ref HEAD
[  +35 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[  +51 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +4 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.  
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +11 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[  +10 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[  +17 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[  +32 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[  +35 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[  +11 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[  +28 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[  +40 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[  +13 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[   +5 ms] Changing current working directory to: C:\dev\git\flutter-webrtc
[ +113 ms] switching to directory LocalDirectory: 'test' to run tests
[   +1 ms] running test package with arguments: [-r, compact, --concurrency=10, --,
C:\dev\git\flutter-webrtc\test\unit\rct_peerconnection_test.dart, C:\dev\git\flutter-webrtc\test\unit\web\rtc_videw_view_test.dart]
00:00 +0: loading C:\dev\git\flutter-webrtc\test\unit\rct_peerconnection_test.dart                                                             [ +222 ms] test 0: starting test C:\dev\git\flutter-webrtc\test\unit\rct_peerconnection_test.dart
[   +9 ms] test 0: starting shell process
[  +28 ms] Stopping scan for flutter_test_config.dart; found project root at C:\dev\git\flutter-webrtc
[   +5 ms] Compiler will use the following file as its incremental dill file:
C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_compiler.b31be359\output.dill
[  +22 ms] Listening to compiler controller...
[  +35 ms] Compiling file:///C:/Users/mathu/AppData/Local/Temp/flutter_tools.9dda751e/flutter_test_listener.dbff04a6/listener.dart
[  +25 ms] C:\dev\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\dev\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\dev\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names
--experimental-emit-debug-metadata -Ddart.developer.causal_async_stacks=true --output-dill
C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_compiler.b31be359\output.dill --packages
C:\dev\git\flutter-webrtc\.packages -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions --enable-asserts --track-widget-creation --initialize-from-dill C:\dev\git\flutter-webrtc\build\testfile.dill.track.dill
[  +94 ms] <- compile file:///C:/Users/mathu/AppData/Local/Temp/flutter_tools.9dda751e/flutter_test_listener.dbff04a6/listener.dart
00:01 +0: loading C:\dev\git\flutter-webrtc\test\unit\rct_peerconnection_test.dart                                                             [+1008 ms] <- accept
[   +1 ms] <- reset
[  +21 ms] Compiling C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_listener.dbff04a6\listener.dart took 1136ms
[   +3 ms] C:\dev\flutter\bin\cache\artifacts\engine\windows-x64\flutter_tester.exe --disable-observatory --enable-checked-mode
--verify-entry-points --enable-software-rendering --skia-deterministic-rendering --enable-dart-profiling --non-interactive --use-test-fonts     
--packages=C:\dev\git\flutter-webrtc\.packages
C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_listener.dbff04a6\listener.dart.dill
[   +4 ms] Using this directory for fonts configuration: C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_fonts.4a8408ef   
[  +32 ms] test 0: awaiting initial result for pid 8640
[ +315 ms] test 0: process with pid 8640 connected to test harness
[   +2 ms] test 0: awaiting test result for pid 8640
00:01 +1: C:\dev\git\flutter-webrtc\test\unit\rct_peerconnection_test.dart: ... delegate this will not break the implementation by throwing NPE[ +173 ms] test 0: process with pid 8640 no longer needed by test harness
[   +2 ms] test 0: cleaning up...
[   +2 ms] test 0: ensuring end-of-process for shell
[  +15 ms] test 0: deleting temporary directory
[  +24 ms] test 0: shutting down test harness socket server
[  +23 ms] test 0: finished
00:01 +1: All tests passed!
[  +53 ms] Deleting C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_compiler.b31be359...
[  +21 ms] killing pid 17696
[  +68 ms] Deleting C:\Users\mathu\AppData\Local\Temp\flutter_tools.9dda751e\flutter_test_fonts.4a8408ef...
[   +5 ms] test package returned with exit code 0
[   +8 ms] "flutter test" took 2 597ms.
[ +287 ms] ensureAnalyticsSent: 252ms
[   +2 ms] Running shutdown hooks
[   +1 ms] Shutdown hook priority 4
[   +1 ms] Shutdown hooks complete
[   +1 ms] exiting with code 0


```

</details>