Configure screen scale for running layout tests on plus devices
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 18:15:50 +0000 (18:15 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 18:15:50 +0000 (18:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173319

Reviewed by Tim Horton.

Source/WebKit2:

* Platform/spi/ios/UIKitSPI.h: Both this and UIKitTestSPI.h define UIKeyboard. Use
a define guard to prevent re-definition.

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Include UIKitTestSPI.h in project.
* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree): Set screen scale to 2.0.
* TestRunnerShared/spi/UIKitTestSPI.h: Copied from Tools/WebKitTestRunner/ios/UIKitSPI.h,
add _setScale for UIScreen.
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Include UIKitTestSPI.h in project.
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: Import UIKitTestSPI.h instead of UIKitSPI.h.
* WebKitTestRunner/ios/HIDEventGenerator.h: Ditto.
* WebKitTestRunner/ios/HIDEventGenerator.mm: Ditto.
* WebKitTestRunner/ios/PlatformWebViewIOS.mm: Ditto.
* WebKitTestRunner/ios/TestControllerIOS.mm: Ditto.
(WTR::TestController::platformInitialize): Set screen scale to 2.0.
* WebKitTestRunner/ios/UIKitSPI.h: Moved to TestRunnerShared/spi/UIKitTestSPI.h.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm: Import UIKitTestSPI.h instead of UIKitSPI.h.
* WebKitTestRunner/ios/mainIOS.mm: Ditto.

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

14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/ios/UIKitSPI.h
Tools/ChangeLog
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/TestRunnerShared/spi/UIKitTestSPI.h [moved from Tools/WebKitTestRunner/ios/UIKitSPI.h with 90% similarity]
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
Tools/WebKitTestRunner/ios/HIDEventGenerator.h
Tools/WebKitTestRunner/ios/HIDEventGenerator.mm
Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
Tools/WebKitTestRunner/ios/TestControllerIOS.mm
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
Tools/WebKitTestRunner/ios/mainIOS.mm

index d7c7c2f..b7910c7 100644 (file)
@@ -1,3 +1,13 @@
+2017-06-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Configure screen scale for running layout tests on plus devices
+        https://bugs.webkit.org/show_bug.cgi?id=173319
+
+        Reviewed by Tim Horton.
+
+        * Platform/spi/ios/UIKitSPI.h: Both this and UIKitTestSPI.h define UIKeyboard. Use
+        a define guard to prevent re-definition.
+
 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
index 8cd9bc2..10e6610 100644 (file)
@@ -212,8 +212,12 @@ typedef enum {
 - (void)candidateListShouldBeDismissed:(id)candidateList;
 @end
 
+// FIXME: https://bugs.webkit.org/show_bug.cgi?id=173341
+#ifndef _WEBKIT_UIKITSPI_UIKEYBOARD
+#define _WEBKIT_UIKITSPI_UIKEYBOARD 1
 @interface UIKeyboard : UIView <UIKeyboardImplGeometryDelegate>
 @end
+#endif
 
 @interface UIKeyboard ()
 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
index f5ca5e8..ed8da7b 100644 (file)
@@ -1,3 +1,26 @@
+2017-06-14  Jonathan Bedard  <jbedard@apple.com>
+
+        Configure screen scale for running layout tests on plus devices
+        https://bugs.webkit.org/show_bug.cgi?id=173319
+
+        Reviewed by Tim Horton.
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Include UIKitTestSPI.h in project.
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (dumpRenderTree): Set screen scale to 2.0.
+        * TestRunnerShared/spi/UIKitTestSPI.h: Copied from Tools/WebKitTestRunner/ios/UIKitSPI.h,
+        add _setScale for UIScreen.
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Include UIKitTestSPI.h in project.
+        * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: Import UIKitTestSPI.h instead of UIKitSPI.h.
+        * WebKitTestRunner/ios/HIDEventGenerator.h: Ditto.
+        * WebKitTestRunner/ios/HIDEventGenerator.mm: Ditto.
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm: Ditto.
+        * WebKitTestRunner/ios/TestControllerIOS.mm: Ditto.
+        (WTR::TestController::platformInitialize): Set screen scale to 2.0.
+        * WebKitTestRunner/ios/UIKitSPI.h: Moved to TestRunnerShared/spi/UIKitTestSPI.h.
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm: Import UIKitTestSPI.h instead of UIKitSPI.h.
+        * WebKitTestRunner/ios/mainIOS.mm: Ditto.
+
 2017-06-14  Alexey Proskuryakov  <ap@apple.com>
 
         Add iOS 11 support to the bot watcher's dashboard
index 4e2ed50..d6310e7 100644 (file)
                2DA2E3A41E1BA54100A3BBD0 /* DumpRenderTreeSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DumpRenderTreeSpellChecker.mm; path = mac/DumpRenderTreeSpellChecker.mm; sourceTree = "<group>"; };
                31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = "<group>"; };
                31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = "<group>"; };
+               31268EBA1EF06A95001963E2 /* UIKitTestSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIKitTestSPI.h; path = ../TestRunnerShared/spi/UIKitTestSPI.h; sourceTree = "<group>"; };
                3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSLayoutTestCommunication.cpp; path = ../TestRunnerShared/IOSLayoutTestCommunication.cpp; sourceTree = "<group>"; };
                3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSLayoutTestCommunication.h; path = ../TestRunnerShared/IOSLayoutTestCommunication.h; sourceTree = "<group>"; };
                32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
                0F6A0DFF1D6E0F8600F1C9A8 /* ios */ = {
                        isa = PBXGroup;
                        children = (
+                               31268EBA1EF06A95001963E2 /* UIKitTestSPI.h */,
                                0F18E70C1D6BAC8C0027E547 /* UIScriptControllerIOS.mm */,
                        );
                        name = ios;
index 00f1740..8cef65d 100644 (file)
 #import "DumpRenderTreeBrowserView.h"
 #import "IOSLayoutTestCommunication.h"
 #import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <QuartzCore/QuartzCore.h>
 #import <WebCore/CoreGraphicsSPI.h>
 #import <WebKit/WAKWindow.h>
@@ -1242,6 +1243,7 @@ void dumpRenderTree(int argc, const char *argv[])
 #if PLATFORM(IOS)
     setUpIOSLayoutTestCommunication();
     [UIApplication sharedApplication].idleTimerDisabled = YES;
+    [[UIScreen mainScreen] _setScale:2.0];
 #endif
 
     signal(SIGILL, &writeCrashedMessageOnFatalError);
similarity index 90%
rename from Tools/WebKitTestRunner/ios/UIKitSPI.h
rename to Tools/TestRunnerShared/spi/UIKitTestSPI.h
index 3a66659..c2a1b02 100644 (file)
@@ -38,6 +38,7 @@
 #import <UIKit/UIView_Private.h>
 #import <UIKit/UIWindow_Private.h>
 #import <UIKit/UIDevice_Private.h>
+#import <UIKit/UIScreen_Private.h>
 
 @interface UIKeyboardPredictionView : UIView
 + (UIKeyboardPredictionView *)activeInstance;
 - (uint32_t)_contextId;
 @end
 
+// FIXME: https://bugs.webkit.org/show_bug.cgi?id=173341
+#ifndef _WEBKIT_UIKITSPI_UIKEYBOARD
+#define _WEBKIT_UIKITSPI_UIKEYBOARD 1
 @interface UIKeyboard : UIView
+@end
+#endif
+
+@interface UIKeyboard ()
 + (void)removeAllDynamicDictionaries;
 @end
 
 @interface UIDevice ()
 - (void)setOrientation:(UIDeviceOrientation)orientation animated:(BOOL)animated;
  @end
+
+@interface UIScreen ()
+- (void)_setScale:(CGFloat)scale;
+@end
  
 #endif // USE(APPLE_INTERNAL_SDK)
 
index c0b2770..711a932 100644 (file)
                0FEBF8581BB61DF20028722D /* HIDEventGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HIDEventGenerator.h; sourceTree = "<group>"; };
                0FEBF8591BB61DF20028722D /* HIDEventGenerator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HIDEventGenerator.mm; sourceTree = "<group>"; };
                0FEBF85B1BB62A370028722D /* IOKitSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IOKitSPI.h; path = ../TestRunnerShared/spi/IOKitSPI.h; sourceTree = "<group>"; };
-               0FEBF85C1BB62D460028722D /* UIKitSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIKitSPI.h; sourceTree = "<group>"; };
                1A3326051B75396500F89F62 /* TestOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestOptions.h; sourceTree = "<group>"; };
                1CA211C71BCA107300B2101F /* FontWithFeatures.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontWithFeatures.otf; sourceTree = "<group>"; };
                1CA211C81BCA107300B2101F /* FontWithFeatures.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontWithFeatures.ttf; sourceTree = "<group>"; };
                2EE52D141890A9FB0010ED21 /* TestControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerIOS.mm; sourceTree = "<group>"; };
                2EE52D161890A9FB0010ED21 /* mainIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = mainIOS.mm; path = ../ios/mainIOS.mm; sourceTree = "<group>"; };
                3110BE0F15BA011400D216AC /* WebNotificationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationProvider.h; sourceTree = "<group>"; };
+               31268EB91EF06A3B001963E2 /* UIKitTestSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIKitTestSPI.h; path = ../TestRunnerShared/spi/UIKitTestSPI.h; sourceTree = "<group>"; };
                3148A0531E6F85B600D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSLayoutTestCommunication.cpp; path = ../TestRunnerShared/IOSLayoutTestCommunication.cpp; sourceTree = "<group>"; };
                3148A0541E6F85B600D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSLayoutTestCommunication.h; path = ../TestRunnerShared/IOSLayoutTestCommunication.h; sourceTree = "<group>"; };
                3164C8EF15D1ADA100EF1FE0 /* WebNotificationProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationProvider.cpp; sourceTree = "<group>"; };
                2DB6187F1D7D598800978D19 /* spi */ = {
                        isa = PBXGroup;
                        children = (
+                               31268EB91EF06A3B001963E2 /* UIKitTestSPI.h */,
                                2DB6187D1D7D58D400978D19 /* CoreGraphicsTestSPI.h */,
                                0FEBF85B1BB62A370028722D /* IOKitSPI.h */,
                        );
                                0FEBF8591BB61DF20028722D /* HIDEventGenerator.mm */,
                                2EE52D131890A9FB0010ED21 /* PlatformWebViewIOS.mm */,
                                2EE52D141890A9FB0010ED21 /* TestControllerIOS.mm */,
-                               0FEBF85C1BB62D460028722D /* UIKitSPI.h */,
                                0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */,
                        );
                        path = ios;
index 0b4f32f..2d5ad7a 100644 (file)
@@ -31,7 +31,7 @@
 #import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <WebKit/WKWebViewPrivate.h>
 @interface WKWebView ()
 
index e732785..34e7917 100644 (file)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 
 #import <CoreGraphics/CGGeometry.h>
 
index 1de729c..7072678 100644 (file)
@@ -27,7 +27,7 @@
 #import "HIDEventGenerator.h"
 
 #import "IOKitSPI.h"
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <WebCore/SoftLinking.h>
 #import <mach/mach_time.h>
 #import <wtf/Assertions.h>
index 0f984e5..9fb916b 100644 (file)
@@ -28,7 +28,7 @@
 
 #import "TestController.h"
 #import "TestRunnerWKWebView.h"
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <WebCore/QuartzCoreSPI.h>
 #import <WebKit/WKImageCG.h>
 #import <WebKit/WKPreferencesPrivate.h>
index 536af17..10ab6a4 100644 (file)
@@ -31,7 +31,7 @@
 #import "PlatformWebView.h"
 #import "TestInvocation.h"
 #import "TestRunnerWKWebView.h"
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <Foundation/Foundation.h>
 #import <UIKit/UIKit.h>
 #import <WebKit/WKPreferencesRefPrivate.h>
@@ -52,6 +52,7 @@ void TestController::platformInitialize()
 {
     setUpIOSLayoutTestCommunication();
     [UIApplication sharedApplication].idleTimerDisabled = YES;
+    [[UIScreen mainScreen] _setScale:2.0];
 }
 
 void TestController::platformDestroy()
index d94e5cf..a65947b 100644 (file)
@@ -33,7 +33,7 @@
 #import "StringFunctions.h"
 #import "TestController.h"
 #import "TestRunnerWKWebView.h"
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import "UIScriptContext.h"
 #import <JavaScriptCore/JavaScriptCore.h>
 #import <JavaScriptCore/OpaqueJSString.h>
index 0dabbc1..ddf0f99 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "HIDEventGenerator.h"
 #import "TestController.h"
-#import "UIKitSPI.h"
+#import "UIKitTestSPI.h"
 #import <UIKit/UIKit.h>
 
 static int _argc;