From c0cc814399d6d692f868fabc5ca438d078103da5 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 5 Oct 2023 17:54:48 +0000 Subject: [PATCH 1/3] Remove support for Internet Explorer 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 | 4 + 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 -------- pkgs/test/pubspec.yaml | 6 +- .../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 | 4 +- pkgs/test_api/dart_test.yaml | 4 - pkgs/test_api/lib/src/backend/runtime.dart | 6 -- pkgs/test_api/pubspec.yaml | 2 +- pkgs/test_core/CHANGELOG.md | 4 + pkgs/test_core/pubspec.yaml | 4 +- 18 files changed, 27 insertions(+), 158 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 6dc8444a2..a2bdb31ff 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.25.0-wip + +* Fully remove support for Internet Explorer. + ## 1.24.7 * Simplify the initialization of the per-suite message channel within browser diff --git a/pkgs/test/README.md b/pkgs/test/README.md index 4bc1c8254..88d99f314 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -346,7 +346,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 509ee1c42..c02785df5 100644 --- a/pkgs/test/doc/configuration.md +++ b/pkgs/test/doc/configuration.md @@ -186,8 +186,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 @@ -352,11 +352,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 @@ -623,7 +622,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 6202c5aff..a4603ed96 100644 --- a/pkgs/test/lib/src/executable.dart +++ b/pkgs/test/lib/src/executable.dart @@ -18,7 +18,6 @@ Future main(List args) async { Runtime.edge, Runtime.firefox, Runtime.safari, - Runtime.internetExplorer ], BrowserPlatform.start); registerPlatformPlugin([ Runtime.experimentalChromeWasm, diff --git a/pkgs/test/lib/src/runner/browser/browser_manager.dart b/pkgs/test/lib/src/runner/browser/browser_manager.dart index c38e103f9..b170140d7 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'; @@ -160,7 +159,6 @@ class BrowserManager { 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/pubspec.yaml b/pkgs/test/pubspec.yaml index 594cbb557..e4735db76 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -1,5 +1,5 @@ name: test -version: 1.24.7 +version: 1.25.0-wip description: >- A full featured library for writing and running Dart tests across platforms. repository: https://github.com/dart-lang/test/tree/master/pkgs/test @@ -34,8 +34,8 @@ dependencies: stream_channel: ^2.1.0 # Use an exact version until the test_api and test_core package are stable. - test_api: 0.6.1 - test_core: 0.5.7 + test_api: 0.7.0 + test_core: 0.5.8 typed_data: ^1.3.0 web_socket_channel: ^2.0.0 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 98fbb89d3..1b6fed9dc 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 && !Platform.isWindows || - runtime == Runtime.safari && !Platform.isMacOS) { + if (runtime == Runtime.safari && !Platform.isMacOS) { continue; } group('--runtime ${runtime.identifier} --compiler ${compiler.identifier}', @@ -112,8 +111,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 6d9a2ffae..99322e981 100644 --- a/pkgs/test/test/runner/runner_test.dart +++ b/pkgs/test/test/runner/runner_test.dart @@ -122,7 +122,7 @@ Output: final _runtimes = '[vm (default), chrome, firefox' '${Platform.isMacOS ? ', safari' : ''}' - '${Platform.isWindows ? ', ie' : ''}, edge, node, ' + ', edge, node, ' 'experimental-chrome-wasm]'; final _runtimeCompilers = [ @@ -130,7 +130,6 @@ final _runtimeCompilers = [ '[chrome]: dart2js (default)', '[firefox]: dart2js (default)', if (Platform.isMacOS) '[safari]: dart2js (default)', - if (Platform.isWindows) '[ie]: dart2js (default)', '[edge]: dart2js (default)', '[node]: dart2js (default)', '[experimental-chrome-wasm]: dart2wasm (default)', diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index 193cd4da2..b01fb12a1 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,4 +1,6 @@ -## 0.6.2-wip +## 0.7.0-wip + +* Remove `Runtime.internetExplorer`. ## 0.6.1 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 c70eb996e..55dfdfc95 100644 --- a/pkgs/test_api/lib/src/backend/runtime.dart +++ b/pkgs/test_api/lib/src/backend/runtime.dart @@ -29,11 +29,6 @@ final class Runtime { 'Safari', 'safari', Compiler.dart2js, [Compiler.dart2js], isBrowser: true, isJS: true); - /// Microsoft Internet Explorer. - static const Runtime internetExplorer = Runtime( - 'Internet Explorer', 'ie', Compiler.dart2js, [Compiler.dart2js], - isBrowser: true, isJS: true); - /// Microsoft Edge (based on Chromium). static const Runtime edge = Runtime( 'Microsoft Edge', 'edge', Compiler.dart2js, [Compiler.dart2js], @@ -60,7 +55,6 @@ final class Runtime { Runtime.chrome, Runtime.firefox, Runtime.safari, - Runtime.internetExplorer, Runtime.edge, Runtime.nodeJS, Runtime.experimentalChromeWasm, diff --git a/pkgs/test_api/pubspec.yaml b/pkgs/test_api/pubspec.yaml index 98151f2bd..8d1e22ad4 100644 --- a/pkgs/test_api/pubspec.yaml +++ b/pkgs/test_api/pubspec.yaml @@ -1,5 +1,5 @@ name: test_api -version: 0.6.2-wip +version: 0.7.0-wip description: >- The user facing API for structuring Dart tests and checking expectations. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_api diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 695e94e68..2ca7a3ff7 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.8-wip + +* Use the latest `test_api` version `0.7` + ## 0.5.7 * Pass --disable-program-split to dart2js to fix tests which use deferred diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 70a250951..be927377a 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -1,5 +1,5 @@ name: test_core -version: 0.5.7 +version: 0.5.8-wip description: A basic library for writing tests and running them on the VM. repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core @@ -26,7 +26,7 @@ dependencies: stack_trace: ^1.10.0 stream_channel: ^2.1.0 # Use an exact version until the test_api package is stable. - test_api: 0.6.1 + test_api: 0.7.0 vm_service: ">=6.0.0 <13.0.0" yaml: ^3.0.0 From 1d155f7fcb3df3146937c9b2163cba86b567ed7f Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Thu, 5 Oct 2023 18:44:50 +0000 Subject: [PATCH 2/3] Another reference --- pkgs/test_core/lib/src/runner/configuration/args.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/test_core/lib/src/runner/configuration/args.dart b/pkgs/test_core/lib/src/runner/configuration/args.dart index 7489d5eb3..ca9437565 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.'); From 6b0a0d2b136303340cc8b104bf0f58a05e6ef72c Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 13 Dec 2023 01:06:51 +0000 Subject: [PATCH 3/3] Deprecate instead of remove --- pkgs/test_api/CHANGELOG.md | 2 +- pkgs/test_api/lib/src/backend/runtime.dart | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/test_api/CHANGELOG.md b/pkgs/test_api/CHANGELOG.md index b01fb12a1..8eef12d16 100644 --- a/pkgs/test_api/CHANGELOG.md +++ b/pkgs/test_api/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.7.0-wip -* Remove `Runtime.internetExplorer`. +* Deprecate `Runtime.internetExplorer`. ## 0.6.1 diff --git a/pkgs/test_api/lib/src/backend/runtime.dart b/pkgs/test_api/lib/src/backend/runtime.dart index 55dfdfc95..66e009c5c 100644 --- a/pkgs/test_api/lib/src/backend/runtime.dart +++ b/pkgs/test_api/lib/src/backend/runtime.dart @@ -29,6 +29,12 @@ final class Runtime { 'Safari', 'safari', Compiler.dart2js, [Compiler.dart2js], isBrowser: true, isJS: 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); + /// Microsoft Edge (based on Chromium). static const Runtime edge = Runtime( 'Microsoft Edge', 'edge', Compiler.dart2js, [Compiler.dart2js],