diff --git a/engine/src/flutter/lib/web_ui/dart_test.yaml b/engine/src/flutter/lib/web_ui/dart_test_chrome.yaml similarity index 64% rename from engine/src/flutter/lib/web_ui/dart_test.yaml rename to engine/src/flutter/lib/web_ui/dart_test_chrome.yaml index 5715dbe897..a43e4e114d 100644 --- a/engine/src/flutter/lib/web_ui/dart_test.yaml +++ b/engine/src/flutter/lib/web_ui/dart_test_chrome.yaml @@ -1,11 +1,11 @@ -# Sources of inspiration for this file: +# For more information on test and runner configurations: # -# * https://github.com/dart-lang/angular/blob/master/dev/tool/test/dart_test_repo.yaml -# * https://github.com/dart-lang/angular/blob/master/_tests/dart_test.yaml +# * https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md#platforms platforms: - chrome - vm + presets: cirrus: override_platforms: diff --git a/engine/src/flutter/lib/web_ui/dart_test_firefox.yaml b/engine/src/flutter/lib/web_ui/dart_test_firefox.yaml new file mode 100644 index 0000000000..6bfa592556 --- /dev/null +++ b/engine/src/flutter/lib/web_ui/dart_test_firefox.yaml @@ -0,0 +1,7 @@ +# For more information on test and runner configurations: +# +# * https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md#platforms + +platforms: + - firefox + - vm diff --git a/engine/src/flutter/lib/web_ui/dev/firefox.dart b/engine/src/flutter/lib/web_ui/dev/firefox.dart index 98e4b242cf..eb05a07a55 100644 --- a/engine/src/flutter/lib/web_ui/dev/firefox.dart +++ b/engine/src/flutter/lib/web_ui/dev/firefox.dart @@ -49,17 +49,19 @@ class Firefox extends Browser { var args = [ url.toString(), if (!debug) '--headless', - '-width $kMaxScreenshotWidth' + '-width $kMaxScreenshotWidth', '-height $kMaxScreenshotHeight', '-new-window', '-new-instance', + '-prefs { "dom.disable_beforeunload" = true, "toolkit.startup.max_resumed_crashes"=999999 } ', '--start-debugger-server $kDevtoolsPort', ]; - final Process process = await Process.start(installation.executable, args); + final Process process = + await Process.start(installation.executable, args); - remoteDebuggerCompleter.complete(getRemoteDebuggerUrl( - Uri.parse('http://localhost:$kDevtoolsPort'))); + remoteDebuggerCompleter.complete( + getRemoteDebuggerUrl(Uri.parse('http://localhost:$kDevtoolsPort'))); unawaited(process.exitCode .then((_) => Directory(dir).deleteSync(recursive: true))); diff --git a/engine/src/flutter/lib/web_ui/dev/supported_browsers.dart b/engine/src/flutter/lib/web_ui/dev/supported_browsers.dart index 8cd0251ad5..3d16f1a620 100644 --- a/engine/src/flutter/lib/web_ui/dev/supported_browsers.dart +++ b/engine/src/flutter/lib/web_ui/dev/supported_browsers.dart @@ -8,6 +8,7 @@ import 'browser.dart'; import 'chrome.dart'; import 'chrome_installer.dart'; import 'common.dart'; +import 'environment.dart'; import 'firefox.dart'; import 'firefox_installer.dart'; // ignore: implementation_imports @@ -30,6 +31,11 @@ class SupportedBrowsers { 'firefox': Runtime.firefox }; + final Map browserToConfiguration = { + 'chrome': '--configuration=${environment.webUiRootDir.path}/dart_test_chrome.yaml', + 'firefox': '--configuration=${environment.webUiRootDir.path}/dart_test_firefox.yaml', + }; + static final SupportedBrowsers _singletonInstance = SupportedBrowsers._(); /// The [SupportedBrowsers] singleton. diff --git a/engine/src/flutter/lib/web_ui/dev/test_runner.dart b/engine/src/flutter/lib/web_ui/dev/test_runner.dart index 8302579508..4889132720 100644 --- a/engine/src/flutter/lib/web_ui/dev/test_runner.dart +++ b/engine/src/flutter/lib/web_ui/dev/test_runner.dart @@ -243,6 +243,7 @@ class TestCommand extends Command { if (isDebug) '--pause-after-load', '--platform=$browser', '--precompiled=${environment.webUiRootDir.path}/build', + SupportedBrowsers.instance.browserToConfiguration[browser], '--', ...testFiles.map((f) => f.relativeToWebUi).toList(), ];