Title: [194115] trunk/Tools
Revision
194115
Author
[email protected]
Date
2015-12-15 14:10:20 -0800 (Tue, 15 Dec 2015)

Log Message

REGRESSION (r192375): DumpRenderTree.app exits immediately with no error
<http://webkit.org/b/152314>

Reviewed by Daniel Bates.

The change to DumpRenderTreeMain.mm in r192375 caused the iOS
code path to exit immediately when calling main().
Unfortunately, DumpRenderTreeMain.mm was used for both
DumpRenderTree command-line binary and DumpRenderTree.app, which
meant that the app would exit immediately with no error code
when run!

The workaround is to introduce a separate source file called
DumpRenderTreeAppMain.mm, similar to what WebKitTestRunner
already does.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add
DumpRenderTreeAppMain.mm to the project.  Make it the only
compiled source for the DumpRenderTree.app target.
* DumpRenderTree/ios/DumpRenderTreeAppMain.mm: Copied from Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm.
(main): Call DumpRenderTreeMain() on iOS.  Assert on OS X in
case someone tries mistakenly to use the app.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
Link to _javascript_Core.framework on iOS for the assert.
* DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig:
Link to _javascript_Core.framework on OS X for the assert.  Remove
unneeded EXCLUDED_SOURCE_FILE_NAMES setting.
* DumpRenderTree/mac/DumpRenderTreeMain.mm:
(main): Add assert for iOS so that a crash occurs if someone
tries to run the wrong command.

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (194114 => 194115)


--- trunk/Tools/ChangeLog	2015-12-15 21:55:34 UTC (rev 194114)
+++ trunk/Tools/ChangeLog	2015-12-15 22:10:20 UTC (rev 194115)
@@ -1,3 +1,36 @@
+2015-12-15  David Kilzer  <[email protected]>
+
+        REGRESSION (r192375): DumpRenderTree.app exits immediately with no error
+        <http://webkit.org/b/152314>
+
+        Reviewed by Daniel Bates.
+
+        The change to DumpRenderTreeMain.mm in r192375 caused the iOS
+        code path to exit immediately when calling main().
+        Unfortunately, DumpRenderTreeMain.mm was used for both
+        DumpRenderTree command-line binary and DumpRenderTree.app, which
+        meant that the app would exit immediately with no error code
+        when run!
+
+        The workaround is to introduce a separate source file called
+        DumpRenderTreeAppMain.mm, similar to what WebKitTestRunner
+        already does.
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add
+        DumpRenderTreeAppMain.mm to the project.  Make it the only
+        compiled source for the DumpRenderTree.app target.
+        * DumpRenderTree/ios/DumpRenderTreeAppMain.mm: Copied from Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm.
+        (main): Call DumpRenderTreeMain() on iOS.  Assert on OS X in
+        case someone tries mistakenly to use the app.
+        * DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig:
+        Link to _javascript_Core.framework on iOS for the assert.
+        * DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig:
+        Link to _javascript_Core.framework on OS X for the assert.  Remove
+        unneeded EXCLUDED_SOURCE_FILE_NAMES setting.
+        * DumpRenderTree/mac/DumpRenderTreeMain.mm:
+        (main): Add assert for iOS so that a crash occurs if someone
+        tries to run the wrong command.
+
 2015-12-14  Tim Horton  <[email protected]>
 
         Frequent crash under -[WKPDFView web_setMinimumSize:]_block_invoke

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (194114 => 194115)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2015-12-15 21:55:34 UTC (rev 194114)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2015-12-15 22:10:20 UTC (rev 194115)
@@ -63,6 +63,7 @@
 		31117B3D15D9A56A00163BC8 /* MockWebNotificationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */; };
 		440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; };
 		4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; };
+		4464CABE1C20A08B00E5BB55 /* DumpRenderTreeAppMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */; };
 		4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD6A11313C8124000EA9737 /* FormValue.cpp */; };
 		5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106803D15CC7B10001A8A23 /* SlowNPPNew.cpp */; };
 		51134C9916014FDC001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51134C9816014FDB001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp */; };
@@ -90,7 +91,6 @@
 		A1158D59189274360088C17B /* PixelDumpSupportIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1158D57189273EB0088C17B /* PixelDumpSupportIOS.mm */; };
 		A134E531188FC27000901D06 /* DumpRenderTreeMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = A134E52F188FC27000901D06 /* DumpRenderTreeMain.mm */; };
 		A134E53618905EFF00901D06 /* AccessibilityCommonMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */; };
-		A19318001892886B001C52B1 /* DumpRenderTreeMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = A134E52F188FC27000901D06 /* DumpRenderTreeMain.mm */; };
 		A8B91ADA0CF3B32F008F91FF /* DumpRenderTreePasteboard.m in Sources */ = {isa = PBXBuildFile; fileRef = A8B91AD70CF3B32F008F91FF /* DumpRenderTreePasteboard.m */; };
 		A8B91ADC0CF3B32F008F91FF /* DumpRenderTreeWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8B91AD90CF3B32F008F91FF /* DumpRenderTreeWindow.mm */; };
 		A8B91BFD0CF522B4008F91FF /* CheckedMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */; };
@@ -263,6 +263,7 @@
 		375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; };
 		417DAA1C137B3E24007C57FB /* WebCoreTestSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreTestSupport.h; path = WebCoreTestSupport/WebCoreTestSupport.h; sourceTree = BUILT_PRODUCTS_DIR; };
 		440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupportMac.mm; path = mac/WebArchiveDumpSupportMac.mm; sourceTree = "<group>"; };
+		4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DumpRenderTreeAppMain.mm; path = ios/DumpRenderTreeAppMain.mm; sourceTree = "<group>"; };
 		44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = cf/WebArchiveDumpSupport.h; sourceTree = "<group>"; };
 		44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = "<group>"; };
 		4AD6A11313C8124000EA9737 /* FormValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormValue.cpp; sourceTree = "<group>"; };
@@ -641,6 +642,7 @@
 		A1158D6A18927CE10088C17B /* ios */ = {
 			isa = PBXGroup;
 			children = (
+				4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */,
 				A1158D55189273EB0088C17B /* DumpRenderTreeBrowserView.h */,
 				A1158D56189273EB0088C17B /* DumpRenderTreeBrowserView.mm */,
 				A19317FC1892855F001C52B1 /* Info.plist */,
@@ -1010,7 +1012,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				A19318001892886B001C52B1 /* DumpRenderTreeMain.mm in Sources */,
+				4464CABE1C20A08B00E5BB55 /* DumpRenderTreeAppMain.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Copied: trunk/Tools/DumpRenderTree/ios/DumpRenderTreeAppMain.mm (from rev 194114, trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm) (0 => 194115)


--- trunk/Tools/DumpRenderTree/ios/DumpRenderTreeAppMain.mm	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/ios/DumpRenderTreeAppMain.mm	2015-12-15 22:10:20 UTC (rev 194115)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(IOS)
+
+#include "DumpRenderTreeMac.h"
+
+int main(int argc, const char *argv[])
+{
+    return DumpRenderTreeMain(argc, argv);
+}
+
+#else
+
+#include <wtf/Assertions.h>
+
+int main(int, const char*[])
+{
+    RELEASE_ASSERT_WITH_MESSAGE(false, "DumpRenderTree.app is not supported on OS X; use DumpRenderTree command.");
+    return 0;
+}
+
+#endif

Modified: trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig (194114 => 194115)


--- trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig	2015-12-15 21:55:34 UTC (rev 194114)
+++ trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig	2015-12-15 22:10:20 UTC (rev 194115)
@@ -23,8 +23,9 @@
 
 #include "BaseTarget.xcconfig"
 
-OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(PLATFORM_NAME)) $(ASAN_OTHER_LDFLAGS);
-OTHER_LDFLAGS_macosx = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebCoreTestSupport -force_load $(BUILT_PRODUCTS_DIR)/libDumpRenderTree.a -framework Carbon -framework Cocoa -framework _javascript_Core -framework OpenGL -framework QuartzCore -framework WebKit;
+OTHER_LDFLAGS = $(inherited) $(PLATFORM_OTHER_LDFLAGS) $(ASAN_OTHER_LDFLAGS);
+PLATFORM_OTHER_LDFLAGS[sdk=iphone*] = -framework _javascript_Core;
+PLATFORM_OTHER_LDFLAGS[sdk=macosx*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebCoreTestSupport -force_load $(BUILT_PRODUCTS_DIR)/libDumpRenderTree.a -framework Carbon -framework Cocoa -framework _javascript_Core -framework OpenGL -framework QuartzCore -framework WebKit;
 LD_RUNPATH_SEARCH_PATHS = "@loader_path/.";
 PRODUCT_NAME = DumpRenderTree;
 SKIP_INSTALL[sdk=macosx*] = NO;

Modified: trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig (194114 => 194115)


--- trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig	2015-12-15 21:55:34 UTC (rev 194114)
+++ trunk/Tools/DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig	2015-12-15 22:10:20 UTC (rev 194115)
@@ -29,6 +29,6 @@
 
 OTHER_LDFLAGS = $(PLATFORM_OTHER_LDFLAGS) $(ASAN_OTHER_LDFLAGS);
 PLATFORM_OTHER_LDFLAGS[sdk=iphone*] = -l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY) -lWebCoreTestSupport -force_load $(BUILT_PRODUCTS_DIR)/libDumpRenderTree.a -framework QuartzCore -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework Foundation -framework GraphicsServices -framework ImageIO -framework MobileCoreServices -framework UIKit -framework WebCore -framework _javascript_Core -framework WebKit $(OTHER_LDFLAGS_FONTS);
+PLATFORM_OTHER_LDFLAGS[sdk=macosx*] = -framework _javascript_Core;
 LD_RUNPATH_SEARCH_PATHS = "@loader_path/.";
 PRODUCT_NAME = DumpRenderTree;
-EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = DumpRenderTreeMain.mm;

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm (194114 => 194115)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm	2015-12-15 21:55:34 UTC (rev 194114)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMain.mm	2015-12-15 22:10:20 UTC (rev 194115)
@@ -34,8 +34,11 @@
 
 #else
 
+#include <wtf/Assertions.h>
+
 int main(int, const char*[])
 {
+    RELEASE_ASSERT_WITH_MESSAGE(false, "DumpRenderTree command is not supported on iOS; use DumpRenderTree.app.");
     return 0;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to