Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to Browser implementation url arguments #2096

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkgs/test/lib/src/runner/browser/firefox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ class Firefox extends Browser {
@override
final name = 'Firefox';

Firefox(url, {ExecutableSettings? settings})
Firefox(Uri url, {ExecutableSettings? settings})
: super(() =>
_startBrowser(url, settings ?? defaultSettings[Runtime.firefox]!));

/// Starts a new instance of Firefox open to the given [url], which may be a
/// [Uri] or a [String].
static Future<Process> _startBrowser(url, ExecutableSettings settings) async {
static Future<Process> _startBrowser(
Uri url, ExecutableSettings settings) async {
var dir = createTempDir();
File(p.join(dir, 'prefs.js')).writeAsStringSync(_preferences);

Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/lib/src/runner/browser/internet_explorer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class InternetExplorer extends Browser {
@override
final name = 'Internet Explorer';

InternetExplorer(url, {ExecutableSettings? settings})
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<Process> _startBrowser(url, ExecutableSettings settings) {
static Future<Process> _startBrowser(Uri url, ExecutableSettings settings) {
return Process.start(settings.executable, [
'-extoff',
'$url',
Expand Down
5 changes: 3 additions & 2 deletions pkgs/test/lib/src/runner/browser/safari.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ class Safari extends Browser {
@override
final name = 'Safari';

Safari(url, {ExecutableSettings? settings})
Safari(Uri url, {ExecutableSettings? settings})
: super(() =>
_startBrowser(url, settings ?? defaultSettings[Runtime.safari]!));

/// Starts a new instance of Safari open to the given [url], which may be a
/// [Uri] or a [String].
static Future<Process> _startBrowser(url, ExecutableSettings settings) async {
static Future<Process> _startBrowser(
Uri url, ExecutableSettings settings) async {
var dir = createTempDir();

// Safari will only open files (not general URLs) via the command-line
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/browser/chrome_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ webSocket.addEventListener("open", function() {
});

test('reports an error in onExit', () {
var chrome = Chrome(Uri.parse('http://dart-lang.org'), configuration(),
var chrome = Chrome(Uri.https('dart.dev'), configuration(),
settings: ExecutableSettings(
linuxExecutable: '_does_not_exist',
macOSExecutable: '_does_not_exist',
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/browser/firefox_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ webSocket.addEventListener("open", function() {
});

test('reports an error in onExit', () {
var firefox = Firefox('http://dart-lang.org',
var firefox = Firefox(Uri.https('dart.dev'),
settings: ExecutableSettings(
linuxExecutable: '_does_not_exist',
macOSExecutable: '_does_not_exist',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ webSocket.addEventListener("open", function() {
});

test('reports an error in onExit', () {
var ie = InternetExplorer('http://dart-lang.org',
var ie = InternetExplorer(Uri.https('dart.dev'),
settings: ExecutableSettings(
linuxExecutable: '_does_not_exist',
macOSExecutable: '_does_not_exist',
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/test/runner/browser/safari_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ webSocket.addEventListener("open", function() {
});

test('reports an error in onExit', () {
var safari = Safari('http://dart-lang.org',
var safari = Safari(Uri.https('dart.dev'),
settings: ExecutableSettings(
linuxExecutable: '_does_not_exist',
macOSExecutable: '_does_not_exist',
Expand Down
Loading