https://bugs.webkit.org/show_bug.cgi?id=203728
Reviewed by Alexey Proskuryakov.
.:
* Makefile:
Descend into Tools/.
Source/ThirdParty:
* gtest/xcode/Config/General.xcconfig:
* gtest/xcode/Config/SDKVariant.xcconfig: Added.
Add SDKVariant.xcconfig to gtest so that it builds into the correct directory.
Tools:
* Makefile:
Only build gtest and TestWebKitAPI for macCatalyst.
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
Make use of WK_COCOA_TOUCH instead of SDK conditionals.
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
* TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
Fix some #ifdefs for macCatalyst.
* TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollToRevealSelection.mm:
(-[LegacyLoadingDelegate webViewDidFinishLoad:]):
* TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm:
(-[AsyncPolicyDelegateForInsetTest webView:didFinishNavigation:]):
(TestWebKitAPI::TEST):
Util::runUntil wants a bool, not a BOOL.
* TestWebKitAPI/config.h:
Import WebKitLegacy.h after WebKit.h. Traditionally WebKit.h includes
WebKitLegacy.h, except in macCatalyst. Many tests depend on being able
to get WebKitLegacy.h this way.
* Scripts/webkitpy/style/checkers/sdkvariant.py:
* Scripts/webkitpy/port/factory.py:
* Scripts/webkitpy/port/mac.py:
Add a MacCatalyst port behind --maccatalyst, and do the bare minimum
required to get it working and finding the right binaries.
It inherits from Mac instead of iOS because for the purposes of
finding and running binaries, dealing with I/O, etc., these are
100% bona fide macOS products.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251941
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2019-11-01 Tim Horton <timothy_horton@apple.com>
+
+ macCatalyst: Get TestWebKitAPI building
+ https://bugs.webkit.org/show_bug.cgi?id=203728
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Makefile:
+ Descend into Tools/.
+
2019-10-31 Alex Christensen <achristensen@apple.com>
Enable more features in Mac CMake build
-TOOLS_MODULE = Tools
-
-ifeq (iosmac,$(SDK_VARIANT))
- DISABLE_WEBKIT_TOOLS = 1
-endif
-
-ifneq (,$(DISABLE_WEBKIT_TOOLS))
- TOOLS_MODULE =
-endif
-
-MODULES = WebKitLibraries Source $(TOOLS_MODULE)
+MODULES = WebKitLibraries Source Tools
all:
@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
+2019-11-01 Tim Horton <timothy_horton@apple.com>
+
+ macCatalyst: Get TestWebKitAPI building
+ https://bugs.webkit.org/show_bug.cgi?id=203728
+
+ Reviewed by Alexey Proskuryakov.
+
+ * gtest/xcode/Config/General.xcconfig:
+ * gtest/xcode/Config/SDKVariant.xcconfig: Added.
+ Add SDKVariant.xcconfig to gtest so that it builds into the correct directory.
+
2019-08-29 Keith Rollin <krollin@apple.com>
Update .xcconfig symbols to reflect the current set of past and future product versions.
//
#include? "../../../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
+#include "SDKVariant.xcconfig"
USE_INTERNAL_SDK = $(USE_INTERNAL_SDK_$(CONFIGURATION));
USE_INTERNAL_SDK_Production = YES;
--- /dev/null
+// Copyright (C) 2019 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. ``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
+// 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.
+
+WK_EMPTY_ = YES;
+WK_NOT_ = YES;
+WK_NOT_YES = NO;
+
+WK_ALTERNATE_FRAMEWORKS_DIR = $(WK_ALTERNATE_FRAMEWORKS_DIR_$(SDK_VARIANT));
+WK_ALTERNATE_FRAMEWORKS_DIR_iosmac = /System/iOSSupport;
+WK_USE_ALTERNATE_FRAMEWORKS_DIR = $(WK_NOT_$(WK_EMPTY_$(WK_ALTERNATE_FRAMEWORKS_DIR)));
+
+WK_ALTERNATE_PLATFORM_NAME = $(WK_ALTERNATE_PLATFORM_NAME_$(SDK_VARIANT));
+WK_ALTERNATE_PLATFORM_NAME_iosmac = maccatalyst;
+WK_USE_ALTERNATE_PLATFORM_NAME = $(WK_NOT_$(WK_EMPTY_$(WK_ALTERNATE_PLATFORM_NAME)));
+
+WK_ALTERNATE_WEBKIT_SDK_PATH = $(WK_ALTERNATE_WEBKIT_SDK_PATH_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR));
+WK_ALTERNATE_WEBKIT_SDK_PATH_YES = $(WK_ALTERNATE_FRAMEWORKS_DIR)/;
+
+WK_PLATFORM_NAME = $(WK_PLATFORM_NAME_ALTERNATE_$(WK_USE_ALTERNATE_PLATFORM_NAME));
+WK_PLATFORM_NAME_ALTERNATE_YES = $(WK_ALTERNATE_PLATFORM_NAME);
+WK_PLATFORM_NAME_ALTERNATE_NO = $(PLATFORM_NAME);
+
+EFFECTIVE_PLATFORM_NAME = $(EFFECTIVE_PLATFORM_NAME_ALTERNATE_$(WK_USE_ALTERNATE_PLATFORM_NAME));
+EFFECTIVE_PLATFORM_NAME_ALTERNATE_YES = -$(WK_ALTERNATE_PLATFORM_NAME);
+EFFECTIVE_PLATFORM_NAME_ALTERNATE_NO = $(EFFECTIVE_PLATFORM_NAME);
+2019-11-01 Tim Horton <timothy_horton@apple.com>
+
+ macCatalyst: Get TestWebKitAPI building
+ https://bugs.webkit.org/show_bug.cgi?id=203728
+
+ Reviewed by Alexey Proskuryakov.
+
+ * Makefile:
+ Only build gtest and TestWebKitAPI for macCatalyst.
+
+ * TestWebKitAPI/Configurations/Base.xcconfig:
+ * TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
+ Make use of WK_COCOA_TOUCH instead of SDK conditionals.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
+ * TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm:
+ * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
+ * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
+ Fix some #ifdefs for macCatalyst.
+
+ * TestWebKitAPI/Tests/WebKitLegacy/ios/ScrollToRevealSelection.mm:
+ (-[LegacyLoadingDelegate webViewDidFinishLoad:]):
+ * TestWebKitAPI/Tests/ios/ScrollViewInsetTests.mm:
+ (-[AsyncPolicyDelegateForInsetTest webView:didFinishNavigation:]):
+ (TestWebKitAPI::TEST):
+ Util::runUntil wants a bool, not a BOOL.
+
+ * TestWebKitAPI/config.h:
+ Import WebKitLegacy.h after WebKit.h. Traditionally WebKit.h includes
+ WebKitLegacy.h, except in macCatalyst. Many tests depend on being able
+ to get WebKitLegacy.h this way.
+
+ * Scripts/webkitpy/style/checkers/sdkvariant.py:
+
+ * Scripts/webkitpy/port/factory.py:
+ * Scripts/webkitpy/port/mac.py:
+ Add a MacCatalyst port behind --maccatalyst, and do the bare minimum
+ required to get it working and finding the right binaries.
+ It inherits from Mac instead of iOS because for the purposes of
+ finding and running binaries, dealing with I/O, etc., these are
+ 100% bona fide macOS products.
+
2019-11-01 Aakash Jain <aakash_jain@apple.com>
[ews] Improve summary string when there are flaky failures in API tests
MODULES += ImageDiff
endif
+ifeq (iosmac,$(SDK_VARIANT))
+ MODULES = ../Source/ThirdParty/gtest/xcode TestWebKitAPI
+endif
+
all:
@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done
optparse.make_option('--ftw', action='store_const', dest='platform',
const=('ftw'),
help=('Alias for --platform=ftw')),
+ optparse.make_option('--maccatalyst', action='store_const', dest='platform',
+ const=('maccatalyst'),
+ help=('Alias for --platform=maccatalyst')),
] + (config.apple_additions().platform_options() if config.apple_additions() else [])
'watch_simulator.WatchSimulatorPort',
'watch_device.WatchDevicePort',
'jsc_only.JscOnlyPort',
+ 'mac.MacCatalystPort',
'mac.MacPort',
'mock_drt.MockDRTPort',
'test.TestPort',
from webkitpy.common.version import Version
from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE
from webkitpy.common.version_name_map import VersionNameMap
-from webkitpy.port.config import apple_additions
+from webkitpy.port.config import apple_additions, Config
from webkitpy.port.darwin import DarwinPort
_log = logging.getLogger(__name__)
configuration['model'] = match.group('model')
return configuration
+
+
+class MacCatalystPort(MacPort):
+ port_name = "maccatalyst"
+
+ def __init__(self, *args, **kwargs):
+ super(MacCatalystPort, self).__init__(*args, **kwargs)
+ self._config = Config(self._executive, self._filesystem, MacCatalystPort.port_name)
"Source/WebCore/Configurations/SDKVariant.xcconfig",
"Source/WebCore/PAL/Configurations/SDKVariant.xcconfig",
"Source/ThirdParty/ANGLE/Configurations/SDKVariant.xcconfig",
+ "Source/ThirdParty/gtest/xcode/Config/SDKVariant.xcconfig",
"Source/ThirdParty/libwebrtc/Configurations/SDKVariant.xcconfig",
]
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[sdk=macosx*] = *IOS.h *IOS.cpp *IOS.mm;
-EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = *Mac.h *Mac.cpp *Mac.mm */mac/*;
+EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_COCOA_TOUCH));
+EXCLUDED_SOURCE_FILE_NAMES_ = *IOS.h *IOS.cpp *IOS.mm;
+EXCLUDED_SOURCE_FILE_NAMES_cocoatouch = *Mac.h *Mac.cpp *Mac.mm */mac/*;
OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS) --system-header-prefix=WebKit/;
OTHER_CFLAGS[sdk=macosx*] = $(inherited) -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
WK_PRIVATE_FRAMEWORKS_DIR_[sdk=iphone*] = $(WK_PRIVATE_FRAMEWORKS_DIR_iphone_$(USE_INTERNAL_SDK));
WK_PRIVATE_FRAMEWORKS_DIR_iphone_ = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/$(WK_TARGET_IOS_VERSION_MAJOR);
-FRAMEWORK_SEARCH_PATHS[sdk=mac*] = $(inherited) $(WK_PRIVATE_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
-FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(inherited) $(WK_PRIVATE_FRAMEWORKS_DIR);
+FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(WK_COCOA_TOUCH));
+FRAMEWORK_SEARCH_PATHS_ = $(inherited) $(WK_PRIVATE_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
+FRAMEWORK_SEARCH_PATHS_cocoatouch = $(inherited) $(WK_PRIVATE_FRAMEWORKS_DIR);
UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZN7testing4Test16TearDownTestCaseEv -Wl,-unexported_symbol -Wl,__ZN7testing4Test13SetUpTestCaseEv
WK_PDFKIT_LDFLAGS = $(WK_PDFKIT_LDFLAGS_$(WK_PLATFORM_NAME));
WK_PDFKIT_LDFLAGS_macosx = -framework PDFKit;
-WK_PDFKIT_LDFLAGS_maccatalyst = -framework PDFKit;
WK_PDFKIT_LDFLAGS_iphoneos = -framework PDFKit;
WK_PDFKIT_LDFLAGS_iphonesimulator = -framework PDFKit;
-OTHER_LDFLAGS = $(inherited) $(UNEXPORTED_SYMBOL_LDFLAGS) -lgtest -force_load $(BUILT_PRODUCTS_DIR)/libTestWebKitAPI.a -framework JavaScriptCore -framework WebKit -lWebCoreTestSupport $(WK_AUTHKIT_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
-OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -framework Cocoa -framework Carbon;
+OTHER_LDFLAGS = $(inherited) $(UNEXPORTED_SYMBOL_LDFLAGS) -lgtest -force_load $(BUILT_PRODUCTS_DIR)/libTestWebKitAPI.a -framework JavaScriptCore -framework WebKit -lWebCoreTestSupport $(WK_AUTHKIT_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH));
+OTHER_LDFLAGS_PLATFORM_ = -framework Cocoa -framework Carbon;
// FIXME: This should not be built on iOS. Instead we should create and use a TestWebKitAPI application.
-OTHER_LDFLAGS_PLATFORM[sdk=iphone*] = -framework WebCore -framework CoreGraphics -framework UIKit -framework MobileCoreServices;
+OTHER_LDFLAGS_PLATFORM_cocoatouch = -framework WebCore -framework CoreGraphics -framework UIKit -framework MobileCoreServices;
LD_RUNPATH_SEARCH_PATHS = "@loader_path";
@end
-#if HAVE(SEC_KEY_PROXY)
+#if HAVE(SEC_KEY_PROXY) && HAVE(SSL)
TEST(Challenge, ClientCertificate)
{
using namespace TestWebKitAPI;
#import "config.h"
-#if ENABLE(DRAG_SUPPORT)
+#if ENABLE(DRAG_SUPPORT) && !PLATFORM(MACCATALYST)
#import "DragAndDropSimulator.h"
#import "PlatformUtilities.h"
#endif // ENABLE(INPUT_TYPE_COLOR)
-#endif // ENABLE(DRAG_SUPPORT)
+#endif // ENABLE(DRAG_SUPPORT) && !PLATFORM(MACCATALYST)
@end
@implementation LegacyLoadingDelegate {
- BOOL _loadComplete;
+ bool _loadComplete;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
- _loadComplete = YES;
+ _loadComplete = true;
}
- (void)waitForDidFinishLoad
#include "config.h"
-#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
+#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#import "ClassMethodSwizzler.h"
#import "DragAndDropSimulator.h"
} // namespace TestWebKitAPI
-#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
+#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#import <WebKit/WKWebViewPrivate.h>
@interface AsyncPolicyDelegateForInsetTest : NSObject<WKNavigationDelegate> {
- @public BOOL _navigationComplete;
+ @public bool _navigationComplete;
}
@property (nonatomic, copy) void (^webContentProcessDidTerminate)(WKWebView *);
@end
- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation
{
- _navigationComplete = YES;
+ _navigationComplete = true;
}
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, viewHeight)]);
[webView scrollView].contentInset = UIEdgeInsetsMake(400, 0, 0, 0);
[webView setNavigationDelegate:delegate.get()];
- delegate->_navigationComplete = NO;
+ delegate->_navigationComplete = false;
NSURL *testResourceURL = [[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"TestWebKitAPI.resources"];
[webView loadHTMLString:veryTallDocumentMarkup baseURL:testResourceURL];
Util::run(&delegate->_navigationComplete);
#endif
#if PLATFORM(COCOA) && defined(__OBJC__)
#import <WebKit/WebKit.h>
+#if PLATFORM(MACCATALYST)
+// Many tests depend on WebKitLegacy.h being implicitly included; however,
+// on macCatalyst, WebKit.h does not include WebKitLegacy.h, so we need
+// to do it explicitly here.
+#import <WebKit/WebKitLegacy.h>
+#endif
#endif
#endif
#define WK_HAVE_C_SPI 1
#endif
-#if !PLATFORM(APPLETV)
+#if !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST)
#define HAVE_SSL 1
#endif
#include "config.h"
#include "DragAndDropSimulator.h"
-#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
+#if ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#import "InstanceMethodSwizzler.h"
#import "PlatformUtilities.h"
@end
-#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY)
+#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)