From b3fb1486c4a49f0fb169edc3d41d114175a642d1 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 13 Dec 2023 08:19:20 -0800 Subject: [PATCH] Remove support for Internet Explorer (#2114) Closes #1614 Use should be replaced by the edge browser. It has been 2 years since we removed support for internet explorer in dart2js. We have not been testing internet explorer integration, and it may already be broken by dart2js changes. Remove every reference to `ie` or internet explorer in the repo. Treat this as non-breaking for `package:test` even though there is a small risk of breaking some users still using internet explorer and it happens to still be working. --- pkgs/test/CHANGELOG.md | 1 + pkgs/test/README.md | 2 +- pkgs/test/dart_test.yaml | 4 - pkgs/test/doc/configuration.md | 13 ++- pkgs/test/lib/src/executable.dart | 1 - .../src/runner/browser/browser_manager.dart | 2 - .../src/runner/browser/default_settings.dart | 2 - .../src/runner/browser/internet_explorer.dart | 34 -------- .../browser/internet_explorer_test.dart | 84 ------------------- .../runner/compiler_runtime_matrix_test.dart | 6 +- pkgs/test/test/runner/runner_test.dart | 3 +- pkgs/test_api/CHANGELOG.md | 1 + pkgs/test_api/dart_test.yaml | 4 - pkgs/test_api/lib/src/backend/runtime.dart | 2 +- .../lib/src/runner/configuration/args.dart | 1 - 15 files changed, 13 insertions(+), 147 deletions(-) delete mode 100644 pkgs/test/lib/src/runner/browser/internet_explorer.dart delete mode 100644 pkgs/test/test/runner/browser/internet_explorer_test.dart diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index c5cb832ed..8bc8da58b 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -12,6 +12,7 @@ feature, which is why we are making this change in a non-breaking release. * If you do require this feature, file an issue and we can look at adding it back. +* **BREAKING**: Fully remove support for Internet Explorer. * Fix running of tests defined under `lib/` with relative imports to other libraries in the package. diff --git a/pkgs/test/README.md b/pkgs/test/README.md index 741ed3815..0ffa484d6 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -348,7 +348,7 @@ only supports boolean operations. The following identifiers are defined: * `safari`: Whether the test is running on Apple Safari. -* `ie`: Whether the test is running on Microsoft Internet Explorer. +* `edge`: Whether the test is running on Microsoft Edge browser. * `node`: Whether the test is running on Node.js. diff --git a/pkgs/test/dart_test.yaml b/pkgs/test/dart_test.yaml index d51aebf07..49af036fe 100644 --- a/pkgs/test/dart_test.yaml +++ b/pkgs/test/dart_test.yaml @@ -39,10 +39,6 @@ tags: add_tags: [dart2js] test_on: mac-os - ie: - add_tags: [dart2js] - test_on: windows - skip: https://github.com/dart-lang/test/issues/1614 edge: add_tags: [dart2js] test_on: windows diff --git a/pkgs/test/doc/configuration.md b/pkgs/test/doc/configuration.md index e759385b1..60259b493 100644 --- a/pkgs/test/doc/configuration.md +++ b/pkgs/test/doc/configuration.md @@ -185,8 +185,8 @@ tested on supported platforms. ```yaml tags: - # Internet Explorer doesn't support promises yet. - promises: {test_on: "browser && !ie"} + # Test on browsers other than firefox + some_feature: {test_on: "browser && !firefox"} ``` The field can also be used at the top level of the configuration file to @@ -351,11 +351,10 @@ to quickly select a given set of tests. ```yaml presets: - # Pass "-P ie" to run only Internet Explorer tests. - ie: + # Pass "-P feature" to run only tests with "feature name" in the name. + feature: plain_names: - - "IE" - - "Internet Explorer" + - "feature name" ``` This field is not supported in the @@ -611,7 +610,7 @@ tags: chrome: {add_tags: [browser]} firefox: {add_tags: [browser]} safari: {add_tags: [browser]} - ie: {add_tags: [browser]} + edge: {add_tags: [browser]} ``` This field is not supported in the diff --git a/pkgs/test/lib/src/executable.dart b/pkgs/test/lib/src/executable.dart index 9e607d403..5780694aa 100644 --- a/pkgs/test/lib/src/executable.dart +++ b/pkgs/test/lib/src/executable.dart @@ -17,7 +17,6 @@ Future main(List args) async { Runtime.edge, Runtime.firefox, Runtime.safari, - Runtime.internetExplorer ], BrowserPlatform.start); await executable.main(args); diff --git a/pkgs/test/lib/src/runner/browser/browser_manager.dart b/pkgs/test/lib/src/runner/browser/browser_manager.dart index 401ac6884..409fbb4ca 100644 --- a/pkgs/test/lib/src/runner/browser/browser_manager.dart +++ b/pkgs/test/lib/src/runner/browser/browser_manager.dart @@ -23,7 +23,6 @@ import '../executable_settings.dart'; import 'browser.dart'; import 'chrome.dart'; import 'firefox.dart'; -import 'internet_explorer.dart'; import 'microsoft_edge.dart'; import 'safari.dart'; @@ -158,7 +157,6 @@ class BrowserManager { Runtime.chrome => Chrome(url, configuration, settings: settings), Runtime.firefox => Firefox(url, settings: settings), Runtime.safari => Safari(url, settings: settings), - Runtime.internetExplorer => InternetExplorer(url, settings: settings), Runtime.edge => MicrosoftEdge(url, configuration, settings: settings), _ => throw ArgumentError('$browser is not a browser.'), }; diff --git a/pkgs/test/lib/src/runner/browser/default_settings.dart b/pkgs/test/lib/src/runner/browser/default_settings.dart index 929d77736..b2b24d3ce 100644 --- a/pkgs/test/lib/src/runner/browser/default_settings.dart +++ b/pkgs/test/lib/src/runner/browser/default_settings.dart @@ -27,8 +27,6 @@ final defaultSettings = UnmodifiableMapView({ macOSExecutable: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', windowsExecutable: r'Mozilla Firefox\firefox.exe', environmentOverride: 'FIREFOX_EXECUTABLE'), - Runtime.internetExplorer: - ExecutableSettings(windowsExecutable: r'Internet Explorer\iexplore.exe'), Runtime.safari: ExecutableSettings( macOSExecutable: '/Applications/Safari.app/Contents/MacOS/Safari', environmentOverride: 'SAFARI_EXECUTABLE'), diff --git a/pkgs/test/lib/src/runner/browser/internet_explorer.dart b/pkgs/test/lib/src/runner/browser/internet_explorer.dart deleted file mode 100644 index 3616e0a6f..000000000 --- a/pkgs/test/lib/src/runner/browser/internet_explorer.dart +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015, 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 'dart:async'; -import 'dart:io'; - -import 'package:test_api/src/backend/runtime.dart'; // ignore: implementation_imports - -import '../executable_settings.dart'; -import 'browser.dart'; -import 'default_settings.dart'; - -/// A class for running an instance of Internet Explorer. -/// -/// Any errors starting or running the process are reported through [onExit]. -class InternetExplorer extends Browser { - @override - final name = 'Internet Explorer'; - - InternetExplorer(Uri url, {ExecutableSettings? settings}) - : super(() => _startBrowser( - url, settings ?? defaultSettings[Runtime.internetExplorer]!)); - - /// Starts a new instance of Internet Explorer open to the given [url], which - /// may be a [Uri] or a [String]. - static Future _startBrowser(Uri url, ExecutableSettings settings) { - return Process.start(settings.executable, [ - '-extoff', - '$url', - ...settings.arguments, - ]); - } -} diff --git a/pkgs/test/test/runner/browser/internet_explorer_test.dart b/pkgs/test/test/runner/browser/internet_explorer_test.dart deleted file mode 100644 index 06e119c0e..000000000 --- a/pkgs/test/test/runner/browser/internet_explorer_test.dart +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2015, 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. - -@TestOn('vm') -@Tags(['ie']) -library; - -import 'package:test/src/runner/browser/internet_explorer.dart'; -import 'package:test/src/runner/executable_settings.dart'; -import 'package:test/test.dart'; -import 'package:test_descriptor/test_descriptor.dart' as d; - -import '../../io.dart'; -import '../../utils.dart'; -import 'code_server.dart'; - -void main() { - setUpAll(precompileTestExecutable); - - test('starts IE with the given URL', () async { - var server = await CodeServer.start(); - - server.handleJavaScript(''' -var webSocket = new WebSocket(window.location.href.replace("http://", "ws://")); -webSocket.addEventListener("open", function() { - webSocket.send("loaded!"); -}); -'''); - var webSocket = server.handleWebSocket(); - - var ie = InternetExplorer(server.url); - addTearDown(() => ie.close()); - - expect(await (await webSocket).stream.first, equals('loaded!')); - }); - - test("a process can be killed synchronously after it's started", () async { - var server = await CodeServer.start(); - - var ie = InternetExplorer(server.url); - await ie.close(); - }); - - test('reports an error in onExit', () { - var ie = InternetExplorer(Uri.https('dart.dev'), - settings: ExecutableSettings( - linuxExecutable: '_does_not_exist', - macOSExecutable: '_does_not_exist', - windowsExecutable: '_does_not_exist')); - expect( - ie.onExit, - throwsA(isApplicationException(startsWith( - 'Failed to run Internet Explorer: $noSuchFileMessage')))); - }); - - test('can run successful tests', () async { - await d.file('test.dart', ''' -import 'package:test/test.dart'; - -void main() { - test("success", () {}); -} -''').create(); - - var test = await runTest(['-p', 'ie', 'test.dart']); - expect(test.stdout, emitsThrough(contains('+1: All tests passed!'))); - await test.shouldExit(0); - }); - - test('can run failing tests', () async { - await d.file('test.dart', ''' -import 'package:test/test.dart'; - -void main() { - test("failure", () => throw TestFailure("oh no")); -} -''').create(); - - var test = await runTest(['-p', 'ie', 'test.dart']); - expect(test.stdout, emitsThrough(contains('-1: Some tests failed.'))); - await test.shouldExit(1); - }); -} diff --git a/pkgs/test/test/runner/compiler_runtime_matrix_test.dart b/pkgs/test/test/runner/compiler_runtime_matrix_test.dart index 1f19e6836..8991dee88 100644 --- a/pkgs/test/test/runner/compiler_runtime_matrix_test.dart +++ b/pkgs/test/test/runner/compiler_runtime_matrix_test.dart @@ -22,8 +22,7 @@ void main() { for (var runtime in Runtime.builtIn) { for (var compiler in runtime.supportedCompilers) { // Ignore the platforms we can't run on this OS. - if (((runtime == Runtime.internetExplorer || runtime == Runtime.edge) && - !Platform.isWindows) || + if ((runtime == Runtime.edge && !Platform.isWindows) || (runtime == Runtime.safari && !Platform.isMacOS)) { continue; } @@ -116,8 +115,7 @@ void main() { }, skip: compiler == Compiler.dart2wasm ? 'Wasm tests are experimental and require special setup' - : [Runtime.firefox, Runtime.nodeJS, Runtime.internetExplorer] - .contains(runtime) && + : [Runtime.firefox, Runtime.nodeJS].contains(runtime) && Platform.isWindows ? 'https://github.com/dart-lang/test/issues/1942' : null); diff --git a/pkgs/test/test/runner/runner_test.dart b/pkgs/test/test/runner/runner_test.dart index dd1afff7b..7e34199c8 100644 --- a/pkgs/test/test/runner/runner_test.dart +++ b/pkgs/test/test/runner/runner_test.dart @@ -121,14 +121,13 @@ Output: final _runtimes = '[vm (default), chrome, firefox' '${Platform.isMacOS ? ', safari' : ''}' - '${Platform.isWindows ? ', ie' : ''}, edge, node]'; + ', edge, node]'; final _runtimeCompilers = [ '[vm]: kernel (default), source, exe', '[chrome]: dart2js (default), dart2wasm', '[firefox]: dart2js (default), dart2wasm', if (Platform.isMacOS) '[safari]: dart2js (default)', - if (Platform.isWindows) '[ie]: dart2js (default)', '[edge]: dart2js (default)', '[node]: dart2js (default)', ].map((str) => ' $str').join('\n'); diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index a761af340..04447347d 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.7.0-wip +* Deprecate `Runtime.internetExplorer`. * Added `dart2wasm` as a supported compiler for the `chrome` runtime. * **BREAKING**: Removed the `experimentalChromeWasm` runtime. * **BREAKING**: Removed `Runtime.isJS` and `Runtime.isWasm`, as this is now diff --git a/pkgs/test_api/dart_test.yaml b/pkgs/test_api/dart_test.yaml index 41845a02d..faff3bbbd 100644 --- a/pkgs/test_api/dart_test.yaml +++ b/pkgs/test_api/dart_test.yaml @@ -35,10 +35,6 @@ tags: add_tags: [dart2js] test_on: mac-os - ie: - add_tags: [dart2js] - test_on: windows - # Tests that run pub. These tests may need to be excluded when there are local # dependency_overrides. pub: diff --git a/pkgs/test_api/lib/src/backend/runtime.dart b/pkgs/test_api/lib/src/backend/runtime.dart index 73a526d67..d875632b2 100644 --- a/pkgs/test_api/lib/src/backend/runtime.dart +++ b/pkgs/test_api/lib/src/backend/runtime.dart @@ -30,6 +30,7 @@ final class Runtime { isBrowser: true); /// Microsoft Internet Explorer. + @Deprecated('Internet Explorer is no longer supported') static const Runtime internetExplorer = Runtime( 'Internet Explorer', 'ie', Compiler.dart2js, [Compiler.dart2js], isBrowser: true); @@ -49,7 +50,6 @@ final class Runtime { Runtime.chrome, Runtime.firefox, Runtime.safari, - Runtime.internetExplorer, Runtime.edge, Runtime.nodeJS, ]; diff --git a/pkgs/test_core/lib/src/runner/configuration/args.dart b/pkgs/test_core/lib/src/runner/configuration/args.dart index 31d04b014..35a75650f 100644 --- a/pkgs/test_core/lib/src/runner/configuration/args.dart +++ b/pkgs/test_core/lib/src/runner/configuration/args.dart @@ -23,7 +23,6 @@ final ArgParser _parser = (() { var allRuntimes = Runtime.builtIn.toList()..remove(Runtime.vm); if (!Platform.isMacOS) allRuntimes.remove(Runtime.safari); - if (!Platform.isWindows) allRuntimes.remove(Runtime.internetExplorer); parser.addFlag('help', abbr: 'h', negatable: false, help: 'Show this usage information.');