Title: [216041] trunk/Tools
Revision
216041
Author
[email protected]
Date
2017-05-01 16:00:39 -0700 (Mon, 01 May 2017)

Log Message

[Cocoa] Replace uses of [get…Class() alloc] in TestWebKitAPI
<https://webkit.org/b/171493>

Reviewed by Dan Bernstein.

* TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:
Remove UIKit soft-link since TestWebKitAPI links to
UIKit.framework.
(TestWebKitAPI::WebKit1_AudioSessionCategoryIOS_Test): Use
UIWindow and UIWebView classes directly.
* TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm:
Remove UIKit soft-link since TestWebKitAPI links to
UIKit.framework.
(RequiresUserActionForPlaybackTest::createWebView): Use UIWindow
class directly.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (216040 => 216041)


--- trunk/Tools/ChangeLog	2017-05-01 22:55:38 UTC (rev 216040)
+++ trunk/Tools/ChangeLog	2017-05-01 23:00:39 UTC (rev 216041)
@@ -1,3 +1,21 @@
+2017-05-01  David Kilzer  <[email protected]>
+
+        [Cocoa] Replace uses of [get…Class() alloc] in TestWebKitAPI
+        <https://webkit.org/b/171493>
+
+        Reviewed by Dan Bernstein.
+
+        * TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:
+        Remove UIKit soft-link since TestWebKitAPI links to
+        UIKit.framework.
+        (TestWebKitAPI::WebKit1_AudioSessionCategoryIOS_Test): Use
+        UIWindow and UIWebView classes directly.
+        * TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm:
+        Remove UIKit soft-link since TestWebKitAPI links to
+        UIKit.framework.
+        (RequiresUserActionForPlaybackTest::createWebView): Use UIWindow
+        class directly.
+
 2017-05-01  Brady Eidson  <[email protected]>
 
         Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm (216040 => 216041)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm	2017-05-01 22:55:38 UTC (rev 216040)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm	2017-05-01 23:00:39 UTC (rev 216041)
@@ -29,16 +29,12 @@
 
 #import "PlatformUtilities.h"
 #import <AVFoundation/AVAudioSession.h>
+#import <UIKit/UIKit.h>
 #import <WebCore/Settings.h>
-#import <UIKit/UIKit.h>
 #import <WebCore/SoftLinking.h>
 #import <WebKit/WebKitLegacy.h>
 #import <wtf/RetainPtr.h>
 
-SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK_CLASS(UIKit, UIWebView)
-SOFT_LINK_CLASS(UIKit, UIWindow)
-
 SOFT_LINK_FRAMEWORK(AVFoundation)
 SOFT_LINK_CLASS(AVFoundation, AVAudioSession)
 SOFT_LINK_CONSTANT(AVFoundation, AVAudioSessionCategoryAmbient, NSString *)
@@ -66,8 +62,8 @@
 TEST(WebKit1, AudioSessionCategoryIOS)
 {
     WebCore::Settings::setShouldManageAudioSessionCategory(true);
-    RetainPtr<UIWindow> uiWindow = adoptNS([[getUIWindowClass() alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-    RetainPtr<UIWebView> uiWebView = adoptNS([[getUIWebViewClass() alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    RetainPtr<UIWindow> uiWindow = adoptNS([[UIWindow alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    RetainPtr<UIWebView> uiWebView = adoptNS([[UIWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
     [uiWindow addSubview:uiWebView.get()];
 
     uiWebView.get().mediaPlaybackRequiresUserAction = NO;

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm (216040 => 216041)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm	2017-05-01 22:55:38 UTC (rev 216040)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm	2017-05-01 23:00:39 UTC (rev 216041)
@@ -28,18 +28,16 @@
 #import "PlatformUtilities.h"
 #import "Test.h"
 #import "TestNavigationDelegate.h"
-#import <WebCore/SoftLinking.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WebKit.h>
 #import <wtf/RetainPtr.h>
 
-#if WK_API_ENABLED
-
 #if TARGET_OS_IPHONE
-SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK_CLASS(UIKit, UIWindow)
+#import <UIKit/UIKit.h>
 #endif
 
+#if WK_API_ENABLED
+
 static bool receivedScriptMessage;
 static RetainPtr<WKScriptMessage> lastScriptMessage;
 
@@ -73,7 +71,7 @@
     {
         webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
 #if TARGET_OS_IPHONE
-        window = adoptNS([[getUIWindowClass() alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+        window = adoptNS([[UIWindow alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
         [window addSubview:webView.get()];
 #else
         window = adoptNS([[NSWindow alloc] initWithContentRect:webView.get().frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to