Skip to content

Commit

Permalink
run-minibrowser should understand the --ios-device command line args
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=247629
rdar://102103002

Reviewed by Brent Fulgham.

This adds support to the old-run-minibrowser Perl script to launch MobileMiniBrowser
in an iOS simulator.

As of at least Xcode 14.1 we don't have the iPhone SE simulator (we support
some later generation of iPhone SE). This patch also bumps the default iPhone simulator to
iPhone 12 which aligns with run-webkit-tests --ios-simulator.

* Tools/Scripts/webkitdirs.pm:
(installedMobileMiniBrowserBundle):
(mobileMiniBrowserBundle):
(findOrCreateSimulatorForIOSDevice):
(runIOSWebKitAppInSimulator):
(runMiniBrowser):

Canonical link: https://commits.webkit.org/256495@main
  • Loading branch information
rreno committed Nov 9, 2022
1 parent ca8aedd commit ebc7511
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Tools/Scripts/webkitdirs.pm
Expand Up @@ -2992,6 +2992,11 @@ sub installedMobileSafariBundle()
return File::Spec->catfile(iosSimulatorApplicationsPath(), "MobileSafari.app");
}

sub installedMobileMiniBrowserBundle()
{
return File::Spec->catfile(iosSimulatorApplicationsPath(), "MobileMiniBrowser.app");
}

sub mobileSafariBundle()
{
determineConfigurationProductDir();
Expand All @@ -3003,6 +3008,17 @@ sub mobileSafariBundle()
return installedMobileSafariBundle();
}

sub mobileMiniBrowserBundle()
{
determineConfigurationProductDir();

if (isIOSWebKit() && -d "$configurationProductDir/MobileMiniBrowser.app") {
return "$configurationProductDir/MobileMiniBrowser.app";
}
return installedMobileMiniBrowserBundle();
}


sub plistPathFromBundle($)
{
my ($appBundle) = @_;
Expand Down Expand Up @@ -3129,8 +3145,8 @@ sub findOrCreateSimulatorForIOSDevice($)
$simulatorName = "iPad Pro " . $simulatorNameSuffix;
$simulatorDeviceType = "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-";
} else {
$simulatorName = "iPhone SE " . $simulatorNameSuffix;
$simulatorDeviceType = "com.apple.CoreSimulator.SimDeviceType.iPhone-SE";
$simulatorName = "iPhone 12 " . $simulatorNameSuffix;
$simulatorDeviceType = "com.apple.CoreSimulator.SimDeviceType.iPhone-12";
}

my $simulatedDevice = iosSimulatorDeviceByName($simulatorName);
Expand Down Expand Up @@ -3358,6 +3374,9 @@ sub runMiniBrowser
my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
}
if (isIOSWebKit()) {
return runIOSWebKitApp(mobileMiniBrowserBundle());
}
return 1;
}

Expand Down

0 comments on commit ebc7511

Please sign in to comment.