Title: [191214] trunk/Tools
Revision
191214
Author
timothy_hor...@apple.com
Date
2015-10-16 15:09:57 -0700 (Fri, 16 Oct 2015)

Log Message

WebKit2.AutoLayoutIntegration API test is failing on some of the bots
https://bugs.webkit.org/show_bug.cgi?id=150255

Reviewed by Simon Fraser.

* Scripts/run-api-tests:
(runTest):
* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:]):
(-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:]):
(-[AutoLayoutWKWebView load:expectingContentSize:]): Deleted.
(-[AutoLayoutWKWebView expectContentSizeChange:]): Deleted.
Don't set the layout size until after the load finishes and we're waiting
for the reply, so that there is no race between the new size coming in
and us waiting for it.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (191213 => 191214)


--- trunk/Tools/ChangeLog	2015-10-16 21:58:58 UTC (rev 191213)
+++ trunk/Tools/ChangeLog	2015-10-16 22:09:57 UTC (rev 191214)
@@ -1,3 +1,21 @@
+2015-10-16  Tim Horton  <timothy_hor...@apple.com>
+
+        WebKit2.AutoLayoutIntegration API test is failing on some of the bots
+        https://bugs.webkit.org/show_bug.cgi?id=150255
+
+        Reviewed by Simon Fraser.
+
+        * Scripts/run-api-tests:
+        (runTest):
+        * TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
+        (-[AutoLayoutWKWebView load:withWidth:expectingContentSize:]):
+        (-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:]):
+        (-[AutoLayoutWKWebView load:expectingContentSize:]): Deleted.
+        (-[AutoLayoutWKWebView expectContentSizeChange:]): Deleted.
+        Don't set the layout size until after the load finishes and we're waiting
+        for the reply, so that there is no race between the new size coming in
+        and us waiting for it.
+
 2015-10-16  Anders Carlsson  <ander...@apple.com>
 
         WebEditingDelegate should be a formal protocol

Modified: trunk/Tools/Scripts/run-api-tests (191213 => 191214)


--- trunk/Tools/Scripts/run-api-tests	2015-10-16 21:58:58 UTC (rev 191213)
+++ trunk/Tools/Scripts/run-api-tests	2015-10-16 22:09:57 UTC (rev 191214)
@@ -53,6 +53,7 @@
 my $verbose = 0;
 my $showLeaks = 0;
 my $dumpTests = 0;
+my $disableTimeout = 0;
 my $build = 1;
 my $root;
 my $buildDefault = $build ? "build" : "do not build";
@@ -68,6 +69,7 @@
   --[no-]build          Build (or do not build) unit tests prior to running (default: $buildDefault)
   --root=               Path to the pre-built root containing TestWebKitAPI
   --show-leaks          Show leaks in the output
+  --no-timeout          Disable test timeouts
 
 Platform options:
   --ios-simulator       Run tests in the iOS Simulator
@@ -88,6 +90,7 @@
     'help' => \$showHelp,
     'verbose|v' => \$verbose,
     'show-leaks' => \$showLeaks,
+    'no-timeout' => \$disableTimeout,
     'dump|d' => \$dumpTests,
     'build!' => \$build,
     'root=s' => \$root
@@ -203,10 +206,14 @@
         }
 
         eval {
-            local $SIG{ALRM} = sub { die "alarm\n" };
-            alarm $timeout;
-            waitpid($pid, 0);
-            alarm 0;
+            if ($disableTimeout) {
+                waitpid($pid, 0);    
+            } else {
+                local $SIG{ALRM} = sub { die "alarm\n" };
+                alarm $timeout;
+                waitpid($pid, 0);
+                alarm 0;
+            }
             $result = $?;
         };
         if ($@) {

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm (191213 => 191214)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm	2015-10-16 21:58:58 UTC (rev 191213)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm	2015-10-16 22:09:57 UTC (rev 191214)
@@ -54,7 +54,7 @@
     NSSize _expectedIntrinsicContentSize;
 }
 
-- (void)load:(NSString *)HTMLString expectingContentSize:(NSSize)size
+- (void)load:(NSString *)HTMLString withWidth:(CGFloat)width expectingContentSize:(NSSize)size
 {
     EXPECT_FALSE(_expectingIntrinsicContentSizeChange);
 
@@ -71,11 +71,13 @@
     [self loadHTMLString:[baseHTML stringByAppendingString:HTMLString] baseURL:nil];
     TestWebKitAPI::Util::run(&didFinishNavigation);
 
-    [self expectContentSizeChange:size];
+    [self layoutAtMinimumWidth:width andExpectContentSizeChange:size];
 }
 
-- (void)expectContentSizeChange:(NSSize)size
+- (void)layoutAtMinimumWidth:(CGFloat)width andExpectContentSizeChange:(NSSize)size
 {
+    [self _setMinimumLayoutWidth:width];
+
     // NOTE: Each adjacent expected result must be different, or we'll early return and not call invalidateIntrinsicContentSize!
     EXPECT_FALSE(NSEqualSizes(size, self.intrinsicContentSize));
 
@@ -83,6 +85,8 @@
     _expectedIntrinsicContentSize = size;
     didInvalidateIntrinsicContentSize = false;
     TestWebKitAPI::Util::run(&didInvalidateIntrinsicContentSize);
+
+    [self _setMinimumLayoutWidth:0];
 }
 
 - (void)invalidateIntrinsicContentSize
@@ -104,34 +108,30 @@
 TEST(WebKit2, AutoLayoutIntegration)
 {
     RetainPtr<AutoLayoutWKWebView> webView = adoptNS([[AutoLayoutWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 1000, 1000)]);
-    [webView _setMinimumLayoutWidth:50];
 
     AutoLayoutNavigationDelegate *delegate = [[AutoLayoutNavigationDelegate alloc] init];
     [webView setNavigationDelegate:delegate];
 
     // 10x10 rect with the constraint (width >= 50) -> 50x10
-    [webView load:@"<div class='small'></div>" expectingContentSize:NSMakeSize(50, 10)];
+    [webView load:@"<div class='small'></div>" withWidth:50 expectingContentSize:NSMakeSize(50, 10)];
 
     // 100x100 rect with the constraint (width >= 50) -> 100x100
-    [webView load:@"<div class='large'></div>" expectingContentSize:NSMakeSize(100, 100)];
+    [webView load:@"<div class='large'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 100)];
 
     // 100x10 rect with the constraint (width >= 50) -> 100x10
-    [webView load:@"<div class='veryWide'></div>" expectingContentSize:NSMakeSize(100, 10)];
+    [webView load:@"<div class='veryWide'></div>" withWidth:50 expectingContentSize:NSMakeSize(100, 10)];
 
     // Ten 10x10 rects, inline, should result in two rows of five; with the constraint (width >= 50) -> 50x20
-    [webView load:@"<div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div>" expectingContentSize:NSMakeSize(50, 20)];
+    [webView load:@"<div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div>" withWidth:50 expectingContentSize:NSMakeSize(50, 20)];
 
     // Changing the width to 10 should result in ten rows of one; with the constraint (width >= 10) -> 10x100
-    [webView _setMinimumLayoutWidth:10];
-    [webView expectContentSizeChange:NSMakeSize(10, 100)];
+    [webView layoutAtMinimumWidth:10 andExpectContentSizeChange:NSMakeSize(10, 100)];
 
     // Changing the width to 100 should result in one rows of ten; with the constraint (width >= 100) -> 100x10
-    [webView _setMinimumLayoutWidth:100];
-    [webView expectContentSizeChange:NSMakeSize(100, 10)];
+    [webView layoutAtMinimumWidth:100 andExpectContentSizeChange:NSMakeSize(100, 10)];
 
     // One 100x100 rect and ten 10x10 rects, inline; with the constraint (width >= 20) -> 100x110
-    [webView _setMinimumLayoutWidth:20];
-    [webView load:@"<div class='large'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div>" expectingContentSize:NSMakeSize(100, 110)];
+    [webView load:@"<div class='large'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div><div class='small inline'></div>" withWidth:20 expectingContentSize:NSMakeSize(100, 110)];
 }
 
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to