dart-sdk/tests/language/import/conditional_import_string_test.dart
Vyacheslav Egorov 775b7bdd73 [tests] Update two conditional import tests
These tests were just failing on the VM for a very long time.

Rewrite them into a simpler version that just tests conditional
importing rather than trying to do clever things with HttpRequest.

R=eernst@google.com

Change-Id: Iebb7f6210ae4f2215c9445695189533116ffb5b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338160
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-11-28 14:27:39 +00:00

26 lines
845 B
Dart

// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import "default.dart"
if (dart.library.io) "io.dart"
if (dart.library.html) "html.dart" deferred as d show value;
void main() async {
asyncStart();
final io = const String.fromEnvironment("dart.library.io") == "true";
final html = const String.fromEnvironment("dart.library.html") == "true";
await d.loadLibrary().timeout(const Duration(seconds: 5));
if (io) {
Expect.equals("io", d.value);
} else if (html) {
Expect.equals("html", d.value);
} else {
Expect.equals("default", d.value);
}
asyncEnd();
}