Title: [266182] trunk/Tools
Revision
266182
Author
[email protected]
Date
2020-08-26 12:54:12 -0700 (Wed, 26 Aug 2020)

Log Message

TestWebKitAPI.AudioRoutingArbitration.Deletion is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=215856
<rdar://problem/66950074>

Reviewed by Jer Noble.

This test deletes a video element by removing it from the DOM, and verifies that
arbitration status changes appropriately. Arbitration status isn't changed until
the element's destructor runs, and that doesn't happen until it is garbage collected
so force GC while waiting for the status to change.

* TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
(AudioRoutingArbitration::statusShouldBecomeEqualTo): Add optional parameter to force
GC while waiting for status to change.
(TEST_F):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (266181 => 266182)


--- trunk/Tools/ChangeLog	2020-08-26 19:44:41 UTC (rev 266181)
+++ trunk/Tools/ChangeLog	2020-08-26 19:54:12 UTC (rev 266182)
@@ -1,3 +1,21 @@
+2020-08-26  Eric Carlson  <[email protected]>
+
+        TestWebKitAPI.AudioRoutingArbitration.Deletion is a constant failure
+        https://bugs.webkit.org/show_bug.cgi?id=215856
+        <rdar://problem/66950074>
+
+        Reviewed by Jer Noble.
+
+        This test deletes a video element by removing it from the DOM, and verifies that 
+        arbitration status changes appropriately. Arbitration status isn't changed until
+        the element's destructor runs, and that doesn't happen until it is garbage collected
+        so force GC while waiting for the status to change.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
+        (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add optional parameter to force
+        GC while waiting for status to change.
+        (TEST_F):
+
 2020-08-26  Youenn Fablet  <[email protected]>
 
         enumerateDevices should expose audiooutput devices that are tied to an audio input device

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm (266181 => 266182)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm	2020-08-26 19:44:41 UTC (rev 266181)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm	2020-08-26 19:54:12 UTC (rev 266182)
@@ -30,6 +30,7 @@
 #import "PlatformUtilities.h"
 #import "Test.h"
 #import "TestWKWebView.h"
+#import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/WKWebViewPrivateForTesting.h>
@@ -59,7 +60,7 @@
         [webView _close];
     }
 
-    void statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatus status, const char* message)
+    void statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatus status, const char* message, bool forceGC = false)
     {
         int tries = 0;
         do {
@@ -66,6 +67,8 @@
             if ([webView _audioRoutingArbitrationStatus] == status)
                 break;
 
+            if (forceGC)
+                [webView.get().configuration.processPool _garbageCollectJavaScriptObjectsForTesting];
             TestWebKitAPI::Util::sleep(0.1);
         } while (++tries <= 100);
 
@@ -106,7 +109,7 @@
 
     [webView objectByEvaluatingJavaScriptWithUserGesture:@"document.querySelector('video').parentNode.innerHTML = ''"];
 
-    statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Deletion 2");
+    statusShouldBecomeEqualTo(WKWebViewAudioRoutingArbitrationStatusNone, "Deletion 2", true);
 }
 
 TEST_F(AudioRoutingArbitration, Close)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to