Title: [231978] trunk/Tools
Revision
231978
Author
[email protected]
Date
2018-05-18 12:33:35 -0700 (Fri, 18 May 2018)

Log Message

"debug-safari --ios-simulator" creates lldb target to launch Mac Safari
https://bugs.webkit.org/show_bug.cgi?id=185774

Reviewed by Andy Estes.

For now, the script debug-safari is not supported for WebKit for iOS. To
fix this we differentiate between the Apple Mac port and Apple embedded
ports.

* Scripts/webkitdirs.pm:
(safariPath): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
(isAppleMacWebKit): Added.
(isAppleCocoaWebKit): Write in terms of isAppleMacWebKit() and isEmbeddedWebKit().
(launcherName): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
(mobileSafariBundle): Substitute isIOSWebKit() for isAppleCocoaWebKit().
(debugSafari): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
(runSafari): Ditto.
(runMiniBrowser): Ditto.
(debugMiniBrowser): Ditto.
(runWebKitTestRunner): Ditto.
(debugWebKitTestRunner): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (231977 => 231978)


--- trunk/Tools/ChangeLog	2018-05-18 19:01:00 UTC (rev 231977)
+++ trunk/Tools/ChangeLog	2018-05-18 19:33:35 UTC (rev 231978)
@@ -1,3 +1,27 @@
+2018-05-18  Daniel Bates  <[email protected]>
+
+        "debug-safari --ios-simulator" creates lldb target to launch Mac Safari
+        https://bugs.webkit.org/show_bug.cgi?id=185774
+
+        Reviewed by Andy Estes.
+
+        For now, the script debug-safari is not supported for WebKit for iOS. To
+        fix this we differentiate between the Apple Mac port and Apple embedded
+        ports.
+
+        * Scripts/webkitdirs.pm:
+        (safariPath): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
+        (isAppleMacWebKit): Added.
+        (isAppleCocoaWebKit): Write in terms of isAppleMacWebKit() and isEmbeddedWebKit().
+        (launcherName): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
+        (mobileSafariBundle): Substitute isIOSWebKit() for isAppleCocoaWebKit().
+        (debugSafari): Substitute isAppleMacWebKit() for isAppleCocoaWebKit().
+        (runSafari): Ditto.
+        (runMiniBrowser): Ditto.
+        (debugMiniBrowser): Ditto.
+        (runWebKitTestRunner): Ditto.
+        (debugWebKitTestRunner): Ditto.
+
 2018-05-18  Antoine Quint  <[email protected]>
 
         [Web Animations] Turn Web Animations with CSS integration on for test runners

Modified: trunk/Tools/Scripts/webkitdirs.pm (231977 => 231978)


--- trunk/Tools/Scripts/webkitdirs.pm	2018-05-18 19:01:00 UTC (rev 231977)
+++ trunk/Tools/Scripts/webkitdirs.pm	2018-05-18 19:33:35 UTC (rev 231978)
@@ -989,7 +989,7 @@
 # Locate Safari.
 sub safariPath
 {
-    die "Safari path is only relevant on Apple Mac platform\n" unless isAppleCocoaWebKit();
+    die "Safari path is only relevant on Apple Mac platform\n" unless isAppleMacWebKit();
 
     my $safariPath;
 
@@ -1373,14 +1373,39 @@
     return 0;
 }
 
+sub isIOSWebKit()
+{
+    return portName() eq iOS;
+}
+
+sub isTVOSWebKit()
+{
+    return portName() eq tvOS;
+}
+
+sub isWatchOSWebKit()
+{
+    return portName() eq watchOS;
+}
+
+sub isEmbeddedWebKit()
+{
+    return isIOSWebKit() || isTVOSWebKit() || isWatchOSWebKit();
+}
+
 sub isAppleWebKit()
 {
     return isAppleCocoaWebKit() || isAppleWinWebKit();
 }
 
+sub isAppleMacWebKit()
+{
+    return portName() eq Mac;
+}
+
 sub isAppleCocoaWebKit()
 {
-    return (portName() eq Mac) || isIOSWebKit() || isTVOSWebKit() || isWatchOSWebKit();
+    return isAppleMacWebKit() || isEmbeddedWebKit();
 }
 
 sub isAppleWinWebKit()
@@ -1466,26 +1491,6 @@
     return xcodeSDKPlatformName() eq "watchsimulator";
 }
 
-sub isIOSWebKit()
-{
-    return portName() eq iOS;
-}
-
-sub isTVOSWebKit()
-{
-    return portName() eq tvOS;
-}
-
-sub isWatchOSWebKit()
-{
-    return portName() eq watchOS;
-}
-
-sub isEmbeddedWebKit()
-{
-    return isIOSWebKit() || isTVOSWebKit() || isWatchOSWebKit();
-}
-
 sub determineNmPath()
 {
     return if $nmPath;
@@ -1647,7 +1652,7 @@
 {
     if (isGtk()) {
         return "MiniBrowser";
-    } elsif (isAppleCocoaWebKit()) {
+    } elsif (isAppleMacWebKit()) {
         return "Safari";
     } elsif (isAppleWinWebKit()) {
         return "MiniBrowser";
@@ -2410,7 +2415,7 @@
     determineConfigurationProductDir();
 
     # Use MobileSafari.app in product directory if present.
-    if (isAppleCocoaWebKit() && -d "$configurationProductDir/MobileSafari.app") {
+    if (isIOSWebKit() && -d "$configurationProductDir/MobileSafari.app") {
         return "$configurationProductDir/MobileSafari.app";
     }
     return installedMobileSafariBundle();
@@ -2723,7 +2728,7 @@
 
 sub debugSafari
 {
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         checkFrameworks();
         execMacWebKitAppForDebugging(safariPath());
     }
@@ -2737,7 +2742,7 @@
         return runIOSWebKitApp(mobileSafariBundle());
     }
 
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         return runMacWebKitApp(safariPath());
     }
 
@@ -2752,20 +2757,19 @@
 
 sub runMiniBrowser
 {
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         return runMacWebKitApp(File::Spec->catfile(productDir(), "MiniBrowser.app", "Contents", "MacOS", "MiniBrowser"));
-    } elsif (isAppleWinWebKit()) {
-        my $result;
+    }
+    if (isAppleWinWebKit()) {
         my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
         return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
     }
-
     return 1;
 }
 
 sub debugMiniBrowser
 {
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         execMacWebKitAppForDebugging(File::Spec->catfile(productDir(), "MiniBrowser.app", "Contents", "MacOS", "MiniBrowser"));
     }
     
@@ -2774,7 +2778,7 @@
 
 sub runWebKitTestRunner
 {
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         return runMacWebKitApp(File::Spec->catfile(productDir(), "WebKitTestRunner"));
     }
 
@@ -2783,7 +2787,7 @@
 
 sub debugWebKitTestRunner
 {
-    if (isAppleCocoaWebKit()) {
+    if (isAppleMacWebKit()) {
         execMacWebKitAppForDebugging(File::Spec->catfile(productDir(), "WebKitTestRunner"));
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to