Title: [243445] trunk/Tools
Revision
243445
Author
[email protected]
Date
2019-03-25 12:09:18 -0700 (Mon, 25 Mar 2019)

Log Message

Pull IPadUserInterfaceSwizzler out into a separate header file
https://bugs.webkit.org/show_bug.cgi?id=196193

Reviewed by Anders Carlsson.

Pull the IPadUserInterfaceSwizzler helper class out into a separate file, so that it may
be used in other API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::IPadUserInterfaceSwizzler::IPadUserInterfaceSwizzler): Deleted.
(TestWebKitAPI::IPadUserInterfaceSwizzler::padUserInterfaceIdiom): Deleted.
* TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h: Added.
(TestWebKitAPI::IPadUserInterfaceSwizzler::IPadUserInterfaceSwizzler):
(TestWebKitAPI::IPadUserInterfaceSwizzler::padUserInterfaceIdiom):

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (243444 => 243445)


--- trunk/Tools/ChangeLog	2019-03-25 18:27:55 UTC (rev 243444)
+++ trunk/Tools/ChangeLog	2019-03-25 19:09:18 UTC (rev 243445)
@@ -1,3 +1,21 @@
+2019-03-25  Wenson Hsieh  <[email protected]>
+
+        Pull IPadUserInterfaceSwizzler out into a separate header file
+        https://bugs.webkit.org/show_bug.cgi?id=196193
+
+        Reviewed by Anders Carlsson.
+
+        Pull the IPadUserInterfaceSwizzler helper class out into a separate file, so that it may
+        be used in other API tests.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
+        (TestWebKitAPI::IPadUserInterfaceSwizzler::IPadUserInterfaceSwizzler): Deleted.
+        (TestWebKitAPI::IPadUserInterfaceSwizzler::padUserInterfaceIdiom): Deleted.
+        * TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h: Added.
+        (TestWebKitAPI::IPadUserInterfaceSwizzler::IPadUserInterfaceSwizzler):
+        (TestWebKitAPI::IPadUserInterfaceSwizzler::padUserInterfaceIdiom):
+
 2019-03-25  Gyuyoung Kim  <[email protected]>
 
         Remove NavigatorContentUtils in WebCore/Modules

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (243444 => 243445)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2019-03-25 18:27:55 UTC (rev 243444)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2019-03-25 19:09:18 UTC (rev 243445)
@@ -2307,6 +2307,7 @@
 		F4CD74C520FDACF500DE3794 /* text-with-async-script.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "text-with-async-script.html"; sourceTree = "<group>"; };
 		F4CD74C720FDB49600DE3794 /* TestURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestURLSchemeHandler.h; sourceTree = "<group>"; };
 		F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestURLSchemeHandler.mm; sourceTree = "<group>"; };
+		F4CDAB3322489FE10057A2D9 /* IPadUserInterfaceSwizzler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPadUserInterfaceSwizzler.h; sourceTree = "<group>"; };
 		F4D2986D20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RunScriptAfterDocumentLoad.mm; sourceTree = "<group>"; };
 		F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropSimulatorIOS.mm; sourceTree = "<group>"; };
 		F4D4F3B71E4E36E400BB2767 /* DragAndDropTestsIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropTestsIOS.mm; sourceTree = "<group>"; };
@@ -2718,6 +2719,7 @@
 			isa = PBXGroup;
 			children = (
 				F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */,
+				F4CDAB3322489FE10057A2D9 /* IPadUserInterfaceSwizzler.h */,
 				2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */,
 				2D61EC3021B0B75C00A7D1CB /* PencilKitTestSPI.h */,
 				F4517B652054C49500C26721 /* TestWKWebViewController.h */,

Modified: trunk/Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm (243444 => 243445)


--- trunk/Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm	2019-03-25 18:27:55 UTC (rev 243444)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/ActionSheetTests.mm	2019-03-25 19:09:18 UTC (rev 243445)
@@ -29,7 +29,7 @@
 #if PLATFORM(IOS_FAMILY)
 
 #import "ClassMethodSwizzler.h"
-#import "InstanceMethodSwizzler.h"
+#import "IPadUserInterfaceSwizzler.h"
 #import "PlatformUtilities.h"
 #import "TestNavigationDelegate.h"
 #import "TestWKWebView.h"
@@ -65,20 +65,6 @@
 
 namespace TestWebKitAPI {
 
-class IPadUserInterfaceSwizzler {
-public:
-    IPadUserInterfaceSwizzler()
-        : m_swizzler([UIDevice class], @selector(userInterfaceIdiom), reinterpret_cast<IMP>(padUserInterfaceIdiom))
-    {
-    }
-private:
-    static UIUserInterfaceIdiom padUserInterfaceIdiom()
-    {
-        return UIUserInterfaceIdiomPad;
-    }
-    InstanceMethodSwizzler m_swizzler;
-};
-
 static RetainPtr<UIViewController> gOverrideViewControllerForFullscreenPresentation;
 static void setOverrideViewControllerForFullscreenPresentation(UIViewController *viewController)
 {

Added: trunk/Tools/TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h (0 => 243445)


--- trunk/Tools/TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/ios/IPadUserInterfaceSwizzler.h	2019-03-25 19:09:18 UTC (rev 243445)
@@ -0,0 +1,51 @@
+/*
+ * 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. 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.
+ */
+
+#pragma once
+
+#if PLATFORM(IOS_FAMILY)
+
+#import "InstanceMethodSwizzler.h"
+#import <UIKit/UIKit.h>
+
+namespace TestWebKitAPI {
+
+class IPadUserInterfaceSwizzler {
+public:
+    IPadUserInterfaceSwizzler()
+        : m_swizzler([UIDevice class], @selector(userInterfaceIdiom), reinterpret_cast<IMP>(padUserInterfaceIdiom))
+    {
+    }
+private:
+    static UIUserInterfaceIdiom padUserInterfaceIdiom(id, SEL)
+    {
+        return UIUserInterfaceIdiomPad;
+    }
+    InstanceMethodSwizzler m_swizzler;
+};
+
+} // namespace TestWebKitAPI
+
+#endif // PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to