Repository: flutter
Issue: Unclear message when flutter tool tries to run web specific code in the tester
Labels: a: tests,tool,d: api docs,platform-web,P3,team-web,triaged-web

## Steps to Reproduce

1. import `dart:html`
2. run flutter test

## Logs

```
Testing started at 10:54 ...
D:\flutter\bin\flutter.bat --no-color test --machine test\flutter_markdown_test.dart

Compiler message:
lib/src/_functions_web.dart:5:8: Error: Not found: 'dart:html'
import 'dart:html'; // ignore: avoid_web_libraries_in_flutter
       ^
lib/src/_functions_web.dart:34:34: Error: Getter not found: 'window'.
      String dirname = p.dirname(window.location.href);
                                 ^^^^^^
lib/src/_functions_web.dart:46:32: Error: Getter not found: 'window'.
      final String userAgent = window.navigator.userAgent;
                               ^^^^^^
dart:async/stream_controller.dart 597:43                      _StreamController.addError
dart:async/stream_controller.dart 864:13                      _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 144:14      _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 135:5       _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 463:27   FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1055:19                                  _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 73:23                       _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart          FlutterPlatform._startTest
package:flutter_tools/src/test/flutter_platform.dart 368:36   FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 321:46   FlutterPlatform.load
package:test_core/src/runner/loader.dart 224:36               Loader.loadFile.<fn>
===== asynchronous gap ===========================
dart:async/zone.dart 1055:19                                  _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 73:23                       _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart                      Loader.loadFile.<fn>
package:test_core/src/runner/load_suite.dart 98:31            new LoadSuite.<fn>.<fn>
package:test_api/src/utils.dart 241:5                         invoke
package:test_core/src/runner/load_suite.dart 97:7             new LoadSuite.<fn>
package:test_api/src/backend/invoker.dart 392:25              Invoker._onRun.<fn>.<fn>.<fn>.<fn>
dart:async/future.dart 176:37                                 new Future.<fn>
package:stack_trace/src/stack_zone_specification.dart 209:15  StackZoneSpecification._run
package:stack_trace/src/stack_zone_specification.dart 119:48  StackZoneSpecification._registerCallback.<fn>
dart:async/zone.dart 1122:38                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 925:7                                    _CustomZone.runGuarded
dart:async/zone.dart 965:23                                   _CustomZone.bindCallbackGuarded.<fn>
package:stack_trace/src/stack_zone_specification.dart 209:15  StackZoneSpecification._run
package:stack_trace/src/stack_zone_specification.dart 119:48  StackZoneSpecification._registerCallback.<fn>
dart:async/zone.dart 1126:13                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 949:23                                   _CustomZone.bindCallback.<fn>
dart:async-patch/timer_patch.dart 23:15                       Timer._createTimer.<fn>
dart:isolate-patch/timer_impl.dart 384:19                     _Timer._runTimers
dart:isolate-patch/timer_impl.dart 418:5                      _Timer._handleMessage
dart:isolate-patch/isolate_patch.dart 174:12                  _RawReceivePortImpl._handleMessage
===== asynchronous gap ===========================
dart:async/zone.dart 1047:19                                  _CustomZone.registerCallback
dart:async/zone.dart 964:22                                   _CustomZone.bindCallbackGuarded
dart:async/timer.dart 54:45                                   new Timer
dart:async/timer.dart 91:9                                    Timer.run
dart:async/future.dart 174:11                                 new Future
package:test_api/src/backend/invoker.dart 391:21              Invoker._onRun.<fn>.<fn>.<fn>
dart:async/zone.dart 1126:13                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 1518:10                                  _runZoned
dart:async/zone.dart 1465:12                                  runZoned
package:test_api/src/backend/invoker.dart 378:9               Invoker._onRun.<fn>.<fn>
dart:async/zone.dart 1126:13                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 1518:10                                  _runZoned
dart:async/zone.dart 1465:12                                  runZoned
package:test_api/src/backend/invoker.dart 144:7               Invoker.guard
package:test_api/src/backend/invoker.dart 428:15              Invoker._guardIfGuarded
package:test_api/src/backend/invoker.dart 377:7               Invoker._onRun.<fn>
package:stack_trace/src/chain.dart 101:24                     Chain.capture.<fn>
dart:async/zone.dart 1126:13                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 1518:10                                  _runZoned
dart:async/zone.dart 1465:12                                  runZoned
package:stack_trace/src/chain.dart 99:12                      Chain.capture
package:test_api/src/backend/invoker.dart 376:11              Invoker._onRun
package:test_api/src/backend/live_test_controller.dart 185:5  LiveTestController._run
package:test_api/src/backend/live_test_controller.dart 40:37  _LiveTest.run
dart:async/future.dart 202:37                                 new Future.microtask.<fn>
dart:async/zone.dart 1122:38                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 925:7                                    _CustomZone.runGuarded
dart:async/zone.dart 965:23                                   _CustomZone.bindCallbackGuarded.<fn>
dart:async/zone.dart 1126:13                                  _rootRun
dart:async/zone.dart 1023:19                                  _CustomZone.run
dart:async/zone.dart 925:7                                    _CustomZone.runGuarded
dart:async/zone.dart 965:23                                   _CustomZone.bindCallbackGuarded.<fn>
dart:async/schedule_microtask.dart 43:21                      _microtaskLoop
dart:async/schedule_microtask.dart 52:5                       _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 118:13                  _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 175:5                   _RawReceivePortImpl._handleMessage

Failed to load "D:\flutter-projects\flutter_markdown\test\flutter_markdown_test.dart":
Compilation failed
Test: D:\flutter-projects\flutter_markdown\test\flutter_markdown_test.dart
Shell: D:\flutter\bin\cache\artifacts\engine\windows-x64\flutter_tester.exe

```

### flutter doctor -v
```
[√] Flutter (Channel master, v1.12.11-pre.9, on Microsoft Windows [Version 10.0.19030.1], locale zh-CN)
    • Flutter version 1.12.11-pre.9 at D:\flutter
    • Framework revision f87cbe05b9 (2 days ago), 2019-11-23 03:09:54 -0500
    • Engine revision 591144dfef
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at D:\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: D:\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.5)
    • Android Studio at D:\Android\Android Studio
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.40.1)
    • VS Code at C:\Users\Yaerin\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.6.0

[√] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 78.0.3904.108
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

```