Make TestWebKitAPI work for iOS
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2013 22:53:14 +0000 (22:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Feb 2013 22:53:14 +0000 (22:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108978

Patch by David Farler <dfarler@apple.com> on 2013-02-09
Reviewed by David Kilzer.

Source/WebCore:

Tests already exist - refactor only.

* WebCore.exp.in: Lumped __ZNK7WebCore4KURL7hasPathEv with related methods.
* platform/KURL.cpp: Inlined hasPath() into the header
* platform/KURL.h: Inlined hasPath() into the header

Tools:

* Makefile: Added TestWebKitAPI to iOS MODULES list.
* TestWebKitAPI/Configurations/Base.xcconfig:
- Include FeatureDefines
- Removed VALID_ARCHS
- Removed FRAMEWORK_SEARCH_PATHS - allows building against other SDKs
- Excluded source files per platform
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
- framework and library switches per platform
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
- Remove explicit framework and library linking (moved to xcconfigs)
- Added iOS main.mm
* TestWebKitAPI/config.h:
- Guard importing Cocoa.h and WebKit2_C.h on iOS
* TestWebKitAPI/ios/mainIOS.mm: Copied from Tools/TestWebKitAPI/mac/main.mm.
* TestWebKitAPI/mac/mainMac.mm: Renamed from Tools/TestWebKitAPI/mac/main.mm.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142381 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/KURL.cpp
Source/WebCore/platform/KURL.h
Tools/ChangeLog
Tools/Makefile
Tools/TestWebKitAPI/Configurations/Base.xcconfig
Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/config.h
Tools/TestWebKitAPI/ios/mainIOS.mm [new file with mode: 0644]
Tools/TestWebKitAPI/mac/mainMac.mm [moved from Tools/TestWebKitAPI/mac/main.mm with 100% similarity]

index ae207c4494276f5165149db6c8ac55eb10ff7785..576eba9962d80eee854c6ab14226ece13011657b 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-09  David Farler  <dfarler@apple.com>
+
+        Make TestWebKitAPI work for iOS
+        https://bugs.webkit.org/show_bug.cgi?id=108978
+
+        Reviewed by David Kilzer.
+
+        Tests already exist - refactor only.
+
+        * WebCore.exp.in: Lumped __ZNK7WebCore4KURL7hasPathEv with related methods.
+        * platform/KURL.cpp: Inlined hasPath() into the header
+        * platform/KURL.h: Inlined hasPath() into the header
+
 2013-02-09  Adam Barth  <abarth@webkit.org>
 
         Load event fires too early with threaded HTML parser
index 4a6118c3d3a9662cdd5e7aed9ef8a50f2bc0ce90..4288c2bb6b512d825fa254dc4b44c89a18a60830 100644 (file)
@@ -2475,7 +2475,6 @@ __ZN7WebCore16ScriptController20windowScriptNPObjectEv
 __ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
 __ZN7WebCore17HTMLPlugInElement11getNPObjectEv
 __ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
-__ZNK7WebCore4KURL7hasPathEv
 #endif
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
@@ -2724,6 +2723,7 @@ __ZN7WebCore12WorkerThread17workerThreadCountEv
 
 #if USE(WTFURL)
 __ZNK7WebCore4KURL6stringEv
+__ZNK7WebCore4KURL7hasPathEv
 __ZNK7WebCore4KURL7hasPortEv
 __ZNK7WebCore4KURL7isEmptyEv
 __ZNK7WebCore4KURL6isNullEv
index 7b6af60fb31c187d888873ad4ad480cdc653a781..1fdf2c6d31e3c639a1dfdf7ea85ccdb5fdc9a61e 100644 (file)
@@ -563,11 +563,6 @@ KURL KURL::copy() const
     return result;
 }
 
-bool KURL::hasPath() const
-{
-    return m_pathEnd != m_portEnd;
-}
-
 String KURL::lastPathComponent() const
 {
     if (!hasPath())
index 261f9e4265993af396f1e9c850a6eef10731bfec..46bf2ade24893424e4f4103344e7c41418c1cf4d 100644 (file)
@@ -353,6 +353,11 @@ inline bool KURL::isValid() const
     return m_isValid;
 }
 
+inline bool KURL::hasPath() const
+{
+    return m_pathEnd != m_portEnd;
+}
+
 inline bool KURL::hasPort() const
 {
     return m_hostEnd < m_portEnd;
index 7fd76ff62598b0fe9f901807b77df9227c30edf1..8179d04b2a1f093fa2f578236e78507cd809b5e6 100644 (file)
@@ -1,3 +1,26 @@
+2013-02-09  David Farler  <dfarler@apple.com>
+
+        Make TestWebKitAPI work for iOS
+        https://bugs.webkit.org/show_bug.cgi?id=108978
+
+        Reviewed by David Kilzer.
+
+        * Makefile: Added TestWebKitAPI to iOS MODULES list.
+        * TestWebKitAPI/Configurations/Base.xcconfig:
+        - Include FeatureDefines
+        - Removed VALID_ARCHS
+        - Removed FRAMEWORK_SEARCH_PATHS - allows building against other SDKs
+        - Excluded source files per platform
+        * TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
+        - framework and library switches per platform
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        - Remove explicit framework and library linking (moved to xcconfigs)
+        - Added iOS main.mm
+        * TestWebKitAPI/config.h:
+        - Guard importing Cocoa.h and WebKit2_C.h on iOS
+        * TestWebKitAPI/ios/mainIOS.mm: Copied from Tools/TestWebKitAPI/mac/main.mm.
+        * TestWebKitAPI/mac/mainMac.mm: Renamed from Tools/TestWebKitAPI/mac/main.mm.
+
 2013-02-09  Justin Schuh  <jschuh@chromium.org>
 
         [CHROMIUM] Suppress c4267 build warnings for Win64 tests
index 930ff8ea8217559fd46c1208a31fcf5366c8ba5a..57f8b74ffec678971f2fdf18330042894e0dbc47 100644 (file)
@@ -1,9 +1,9 @@
 MODULES = DumpRenderTree WebKitTestRunner MiniBrowser ../Source/ThirdParty/gtest/xcode TestWebKitAPI
 
 ifneq (,$(findstring iphoneos,$(SDKROOT)))
-       MODULES = ../Source/ThirdParty/gtest/xcode
+       MODULES = ../Source/ThirdParty/gtest/xcode TestWebKitAPI
 else ifneq (,$(findstring iphonesimulator,$(SDKROOT)))
-       MODULES = DumpRenderTree ../Source/ThirdParty/gtest/xcode
+       MODULES = DumpRenderTree ../Source/ThirdParty/gtest/xcode TestWebKitAPI
 endif
 
 all:
index 1e029d4ebc514519af75c9b4049d38be68702872..f03572a03a3914a9a2afe3a172116bfe9b2a7be0 100644 (file)
@@ -25,8 +25,9 @@ CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu;
-FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
-GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_RTTI=0;
+
+GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_RTTI=0 $(GCC_PREPROCESSOR_DEFINITIONS_$(PLATFORM_NAME));
+GCC_PREPROCESSOR_DEFINITIONS_macosx = ENABLE_DASHBOARD_SUPPORT;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
 PREBINDING = NO
 GCC_C_LANGUAGE_STANDARD = gnu99
@@ -40,7 +41,6 @@ GCC_WARN_UNUSED_FUNCTION = YES
 GCC_WARN_UNUSED_VARIABLE = YES
 WARNING_CFLAGS = -Wall -W -Wno-unused-parameter
 LINKER_DISPLAYS_MANGLED_NAMES = YES;
-VALID_ARCHS = i386 x86_64;
 
 // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
 // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
@@ -63,3 +63,8 @@ SDKROOT_TARGETING_SAME_OS_X_VERSION_ = macosx;
 
 WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
 WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
+
+EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
+EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm;
+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *Mac.h *Mac.cpp *Mac.mm *InjectedBundle* *PlatformUtilities* Tests/WebKit2/* Tests/WebKit2ObjC/* *_Bundle* JavaScriptTest.*;
+EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
index c2ab7cd23bb7cd9696990e9a1449ba02e0a692f6..5fc6f744945e9e2733d8fff29c357c5c2ca5bd8a 100644 (file)
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
-PRODUCT_NAME = TestWebKitAPI
-GCC_ENABLE_OBJC_EXCEPTIONS = YES
+PRODUCT_NAME = TestWebKitAPI;
+GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+
+OTHER_LDFLAGS = -lgtest -framework JavaScriptCore -framework WebKit $(OTHER_LDFLAGS_$(PLATFORM_NAME));
+OTHER_LDFLAGS_iphoneos = -framework WebCore;
+OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos);
+OTHER_LDFLAGS_macosx = -framework Cocoa -framework Carbon -framework WebKit2;
index cb9ed857b288034653defa79395966ad34aa6f8c..a1cc291ee413c5fb452e0d105c29da3ed733f5e7 100644 (file)
@@ -36,6 +36,8 @@
                2943BE86161DFEB800999E3D /* UserContentTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2943BE84161DFEB800999E3D /* UserContentTest.mm */; };
                29AB8AA1164C735800D49BEC /* CustomProtocolsTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AB8A9F164C735800D49BEC /* CustomProtocolsTest.mm */; };
                29AB8AA4164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */; };
+               2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */; };
+               2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CE16C4D81100BA2BB1 /* mainMac.mm */; };
                333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
                33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */; };
                33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
                BC029B181486AD6400817DA9 /* RetainPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC029B161486AD6400817DA9 /* RetainPtr.cpp */; };
                BC029B1C1486B25900817DA9 /* RetainPtr.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC029B1B1486B25900817DA9 /* RetainPtr.mm */; };
                BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
-               BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; };
                BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC131AA8117131FC00B69727 /* TestsController.cpp */; };
                BC22D31514DC689800FFB1DD /* UserMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22D31314DC689800FFB1DD /* UserMessage.cpp */; };
                BC22D31914DC68B900FFB1DD /* UserMessage_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22D31714DC68B800FFB1DD /* UserMessage_Bundle.cpp */; };
                BC901E331492AF390074A667 /* WKConnection_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC901E311492AF390074A667 /* WKConnection_Bundle.cpp */; };
                BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90955C125548AA00083756 /* PlatformWebViewMac.mm */; };
                BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90964B125561BF00083756 /* VectorBasic.cpp */; };
-               BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC90964D1255620C00083756 /* JavaScriptCore.framework */; };
                BC90977A125571AB00083756 /* PageLoadBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC909779125571AB00083756 /* PageLoadBasic.cpp */; };
                BC909784125571CF00083756 /* simple.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = BC909778125571AB00083756 /* simple.html */; };
                BC90995E12567BC100083756 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90995D12567BC100083756 /* WKString.cpp */; };
                BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9099931256ACF100083756 /* WKStringJSString.cpp */; };
-               BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA61DB411700EFD00460D1E /* WebKit2.framework */; };
                BCAA485614A0444C0088FAC4 /* simple-tall.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCAA485514A021640088FAC4 /* simple-tall.html */; };
                BCAA485814A044D40088FAC4 /* EditorCommands.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAA485714A044D40088FAC4 /* EditorCommands.mm */; };
                BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */; };
                BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */; };
-               BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB9E9F011235BDE00A137E0 /* Cocoa.framework */; };
                BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */; };
                BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
                BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */; };
                C01363C813C3997300EF3964 /* StringOperators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01363C713C3997300EF3964 /* StringOperators.cpp */; };
                C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C02B7882126615410026BF0F /* spacebar-scrolling.html */; };
                C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; };
-               C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C02B7853126613AE0026BF0F /* Carbon.framework */; };
                C045F9451385C2EA00C0F3CD /* DownloadDecideDestinationCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C045F9441385C2E900C0F3CD /* DownloadDecideDestinationCrash.cpp */; };
                C07E6CAF13FD67650038B22B /* DynamicDeviceScaleFactor.mm in Sources */ = {isa = PBXBuildFile; fileRef = C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */; };
                C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C07E6CB113FD738A0038B22B /* devicePixelRatio.html */; };
                C081224213FC172400DC39AE /* JavaScriptTestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C081224013FC172400DC39AE /* JavaScriptTestMac.mm */; };
                C081224513FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C081224413FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.m */; };
-               C081224913FC1B0300DC39AE /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C081224813FC1B0300DC39AE /* WebKit.framework */; };
                C08587BF13FE956C001EF4E5 /* WebKitAgnosticTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587BD13FE956C001EF4E5 /* WebKitAgnosticTest.mm */; };
                C08587FC13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FB13FEC39B001EF4E5 /* InstanceMethodSwizzler.mm */; };
                C085880013FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */; };
                E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */; };
                E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; };
                E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; };
-               F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; };
                F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */; };
                F660AA1115A5F631003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0F15A5F624003A1243 /* GetInjectedBundleInitializationUserDataCallback_Bundle.cpp */; };
                F660AA1315A619C9003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA1215A619C8003A1243 /* InjectedBundleInitializationUserDataCallbackWins.cpp */; };
                29AB8A9F164C735800D49BEC /* CustomProtocolsTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CustomProtocolsTest.mm; path = WebKit2ObjC/CustomProtocolsTest.mm; sourceTree = "<group>"; };
                29AB8AA2164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestBrowsingContextLoadDelegate.mm; sourceTree = "<group>"; };
                29AB8AA3164C7A9300D49BEC /* TestBrowsingContextLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestBrowsingContextLoadDelegate.h; sourceTree = "<group>"; };
+               2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mainIOS.mm; sourceTree = "<group>"; };
+               2E7765CE16C4D81100BA2BB1 /* mainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = mainMac.mm; sourceTree = "<group>"; };
                333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
                33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = "<group>"; };
                33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = "<group>"; };
                BC029B1B1486B25900817DA9 /* RetainPtr.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RetainPtr.mm; path = WTF/ns/RetainPtr.mm; sourceTree = "<group>"; };
                BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; };
                BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUtilitiesMac.mm; sourceTree = "<group>"; };
-               BC131A9A1171316900B69727 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
                BC131A9E1171317C00B69727 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
                BC131AA8117131FC00B69727 /* TestsController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = TestsController.cpp; sourceTree = "<group>"; };
                BC22D31314DC689800FFB1DD /* UserMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessage.cpp; sourceTree = "<group>"; };
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */,
-                               BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */,
-                               BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */,
-                               F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */,
-                               C081224913FC1B0300DC39AE /* WebKit.framework in Frameworks */,
-                               BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        isa = PBXGroup;
                        children = (
                                BC575944126E733C006F0F12 /* InjectedBundle */,
+                               2E9660DC16C07D7B00371B42 /* ios */,
                                BCA61C3A11700B9400460D1E /* mac */,
                                BC131A9E1171317C00B69727 /* config.h */,
                                C0ADBE7A12FCA4D000D2C129 /* JavaScriptTest.cpp */,
                        name = Products;
                        sourceTree = "<group>";
                };
+               2E9660DC16C07D7B00371B42 /* ios */ = {
+                       isa = PBXGroup;
+                       children = (
+                               2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */,
+                       );
+                       path = ios;
+                       sourceTree = "<group>";
+               };
                440A1D3614A01000008A66F2 /* WebCore */ = {
                        isa = PBXGroup;
                        children = (
                                C08587FE13FEC3A6001EF4E5 /* InstanceMethodSwizzler.h */,
                                C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */,
                                C081224013FC172400DC39AE /* JavaScriptTestMac.mm */,
-                               BC131A9A1171316900B69727 /* main.mm */,
+                               2E7765CE16C4D81100BA2BB1 /* mainMac.mm */,
                                BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */,
                                BC90955C125548AA00083756 /* PlatformWebViewMac.mm */,
                                C081224313FC19EC00DC39AE /* SyntheticBackingScaleFactorWindow.h */,
                                26300B1816755CD90066886D /* ListHashSet.cpp in Sources */,
                                52CB47411448FB9300873995 /* LoadAlternateHTMLStringWithNonDirectoryURL.cpp in Sources */,
                                33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */,
-                               BC131A9B1171316900B69727 /* main.mm in Sources */,
                                B4039F9D15E6D8B3007255D6 /* MathExtras.cpp in Sources */,
                                CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */,
                                E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */,
                                BC90995E12567BC100083756 /* WKString.cpp in Sources */,
                                BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */,
                                265AF55015D1E48A00B0CB4A /* WTFString.cpp in Sources */,
+                               2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */,
+                               2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 4ee066be4f22bfb44136095df9c2872b241910e5..d4714cd080d901453d29bdf0aca62cdb4e4c5504 100644 (file)
 #if defined(__APPLE__) && __APPLE__
 
 #ifdef __OBJC__
+#if PLATFORM(IOS)
+#import <Foundation/Foundation.h>
+#else
 #import <Cocoa/Cocoa.h>
 #endif
+#endif
 
 #elif defined(WIN32) || defined(_WIN32)
 
@@ -66,7 +70,7 @@
 
 #include <stdint.h>
 
-#if (!PLATFORM(CHROMIUM) && !PLATFORM(WIN)) || (PLATFORM(GTK) && defined(BUILDING_WEBKIT2__))
+#if !PLATFORM(IOS) && ((!PLATFORM(CHROMIUM) && !PLATFORM(WIN)) || (PLATFORM(GTK) && defined(BUILDING_WEBKIT2__)))
 #include <WebKit2/WebKit2_C.h>
 #endif
 
diff --git a/Tools/TestWebKitAPI/ios/mainIOS.mm b/Tools/TestWebKitAPI/ios/mainIOS.mm
new file mode 100644 (file)
index 0000000..3eec9b0
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#import "config.h"
+#import "TestsController.h"
+
+int main(int argc, char** argv)
+{
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    bool passed = TestWebKitAPI::TestsController::shared().run(argc, argv);
+
+    [pool drain];
+
+    return passed ? EXIT_SUCCESS : EXIT_FAILURE;
+}