Title: [287342] trunk/Tools
Revision
287342
Author
[email protected]
Date
2021-12-21 20:17:09 -0800 (Tue, 21 Dec 2021)

Log Message

Enable Fullscreen.LayoutConstraints API test
https://bugs.webkit.org/show_bug.cgi?id=234576

Reviewed by Tim Horton.

Added in bug 159900 and not compiled until bug 232768, now it's giving us some useful test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (287341 => 287342)


--- trunk/Tools/ChangeLog	2021-12-22 04:09:39 UTC (rev 287341)
+++ trunk/Tools/ChangeLog	2021-12-22 04:17:09 UTC (rev 287342)
@@ -1,5 +1,17 @@
 2021-12-21  Alex Christensen  <[email protected]>
 
+        Enable Fullscreen.LayoutConstraints API test
+        https://bugs.webkit.org/show_bug.cgi?id=234576
+
+        Reviewed by Tim Horton.
+
+        Added in bug 159900 and not compiled until bug 232768, now it's giving us some useful test coverage.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm:
+        (TestWebKitAPI::TEST):
+
+2021-12-21  Alex Christensen  <[email protected]>
+
         Fix some API tests after r287316
         https://bugs.webkit.org/show_bug.cgi?id=232857
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm (287341 => 287342)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm	2021-12-22 04:09:39 UTC (rev 287341)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLayoutConstraints.mm	2021-12-22 04:17:09 UTC (rev 287342)
@@ -29,6 +29,7 @@
 
 #import "DeprecatedGlobalValues.h"
 #import "PlatformUtilities.h"
+#import "TestWKWebView.h"
 #import <WebKit/WKPreferencesPrivate.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
@@ -50,16 +51,15 @@
 
 namespace TestWebKitAPI {
 
-// FIXME: Fix and enable this test.
-TEST(Fullscreen, DISABLED_LayoutConstraints)
+TEST(Fullscreen, LayoutConstraints)
 {
     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     [configuration preferences]._fullScreenEnabled = YES;
-    RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]);
     RetainPtr<FullscreenStateChangeMessageHandler> handler = adoptNS([[FullscreenStateChangeMessageHandler alloc] init]);
     [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenStateChangeHandler"];
 
-    RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]);
+    RetainPtr window { webView.get().hostWindow };
     webView.get().translatesAutoresizingMaskIntoConstraints = NO;
     [[window contentView] addSubview:webView.get()];
     
@@ -86,7 +86,9 @@
     TestWebKitAPI::Util::run(&receivedFullscreenChangeMessage);
 
     NSArray* finalConstraints = [[window contentView] constraints];
-    ASSERT_TRUE([originalConstraints isEqual:finalConstraints]);
+    EXPECT_EQ(originalConstraints.count, 4u);
+    EXPECT_EQ(finalConstraints.count, 8u);
+    ASSERT_TRUE([originalConstraints isEqual:[finalConstraints subarrayWithRange:NSMakeRange(0, 4)]]);
 }
     
 } // namespace TestWebKitAPI
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to