Title: [213287] trunk
Revision
213287
Author
ryanhad...@apple.com
Date
2017-03-02 10:19:41 -0800 (Thu, 02 Mar 2017)

Log Message

Unreviewed, rolling out r213281.

This change caused API test WebKit2.UserMediaBasic to time
out.

Reverted changeset:

"[MediaStream] UIClient may not be notified of capture state
change when leaving a page"
https://bugs.webkit.org/show_bug.cgi?id=169014
http://trac.webkit.org/changeset/213281

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213286 => 213287)


--- trunk/Source/WebCore/ChangeLog	2017-03-02 18:14:55 UTC (rev 213286)
+++ trunk/Source/WebCore/ChangeLog	2017-03-02 18:19:41 UTC (rev 213287)
@@ -1,3 +1,17 @@
+2017-03-02  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r213281.
+
+        This change caused API test WebKit2.UserMediaBasic to time
+        out.
+
+        Reverted changeset:
+
+        "[MediaStream] UIClient may not be notified of capture state
+        change when leaving a page"
+        https://bugs.webkit.org/show_bug.cgi?id=169014
+        http://trac.webkit.org/changeset/213281
+
 2017-03-02  Jon Lee  <jon...@apple.com>
 
         Improve consistency of captions rendering on Mac

Modified: trunk/Source/WebCore/dom/Document.cpp (213286 => 213287)


--- trunk/Source/WebCore/dom/Document.cpp	2017-03-02 18:14:55 UTC (rev 213286)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-03-02 18:19:41 UTC (rev 213287)
@@ -2327,11 +2327,6 @@
     }
 #endif
 
-    if (page() && m_mediaState != MediaProducer::IsNotPlaying) {
-        m_mediaState = MediaProducer::IsNotPlaying;
-        page()->updateIsPlayingMedia(HTMLMediaElementInvalidID);
-    }
-
     detachFromFrame();
 
     m_hasPreparedForDestruction = true;

Modified: trunk/Tools/ChangeLog (213286 => 213287)


--- trunk/Tools/ChangeLog	2017-03-02 18:14:55 UTC (rev 213286)
+++ trunk/Tools/ChangeLog	2017-03-02 18:19:41 UTC (rev 213287)
@@ -1,3 +1,17 @@
+2017-03-02  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r213281.
+
+        This change caused API test WebKit2.UserMediaBasic to time
+        out.
+
+        Reverted changeset:
+
+        "[MediaStream] UIClient may not be notified of capture state
+        change when leaving a page"
+        https://bugs.webkit.org/show_bug.cgi?id=169014
+        http://trac.webkit.org/changeset/213281
+
 2017-03-02  Tomas Popela  <tpop...@redhat.com>
 
         [WK2] Keyboard menu key should show context menu

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp (213286 => 213287)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp	2017-03-02 18:14:55 UTC (rev 213286)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp	2017-03-02 18:19:41 UTC (rev 213287)
@@ -25,9 +25,6 @@
 #include "PlatformUtilities.h"
 #include "PlatformWebView.h"
 #include "Test.h"
-#include <WebKit/WKPagePrivate.h>
-#include <WebKit/WKPreferencesRef.h>
-#include <WebKit/WKPreferencesRefPrivate.h>
 #include <WebKit/WKRetainPtr.h>
 #include <string.h>
 #include <vector>
@@ -34,16 +31,10 @@
 
 namespace TestWebKitAPI {
 
-static bool wasPrompted;
-static bool isPlayingChanged;
-static bool didFinishLoad;
+static bool done;
 
-static void nullJavaScriptCallback(WKSerializedScriptValueRef, WKErrorRef error, void*)
+void decidePolicyForUserMediaPermissionRequestCallBack(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKSecurityOriginRef, WKUserMediaPermissionRequestRef permissionRequest, const void* /* clientInfo */)
 {
-}
-
-static void decidePolicyForUserMediaPermissionRequestCallBack(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKSecurityOriginRef, WKUserMediaPermissionRequestRef permissionRequest, const void* /* clientInfo */)
-{
     WKRetainPtr<WKArrayRef> audioDeviceUIDs = WKUserMediaPermissionRequestAudioDeviceUIDs(permissionRequest);
     WKRetainPtr<WKArrayRef> videoDeviceUIDs = WKUserMediaPermissionRequestVideoDeviceUIDs(permissionRequest);
 
@@ -63,73 +54,27 @@
         WKUserMediaPermissionRequestAllow(permissionRequest, audioDeviceUID.get(), videoDeviceUID.get());
     }
 
-    wasPrompted = true;
+    done = true;
 }
 
-static void isPlayingDidChangeCallback(WKPageRef page, const void*)
+TEST(WebKit2, DISABLED_UserMediaBasic)
 {
-    isPlayingChanged = true;
-}
-
-static void didFinishLoadForFrame(WKPageRef page, WKFrameRef, WKTypeRef, const void*)
-{
-    didFinishLoad = true;
-}
-
-TEST(WebKit2, UserMediaBasic)
-{
     auto context = adoptWK(WKContextCreate());
+    PlatformWebView webView(context.get());
+    WKPageUIClientV5 uiClient;
+    memset(&uiClient, 0, sizeof(uiClient));
 
-    WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
-    WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
-    WKPreferencesSetMediaStreamEnabled(preferences, true);
-    WKPreferencesSetFileAccessFromFileURLsAllowed(preferences, true);
-    WKPreferencesSetMediaCaptureRequiresSecureConnection(preferences, false);
-    WKPreferencesSetMockCaptureDevicesEnabled(preferences, true);
 
-    WKPageLoaderClientV0 loaderClient;
-    memset(&loaderClient, 0, sizeof(loaderClient));
-    loaderClient.base.version = 0;
-    loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
-
-    WKPageUIClientV6 uiClient;
-    memset(&uiClient, 0, sizeof(uiClient));
-    uiClient.base.version = 6;
-    uiClient.isPlayingAudioDidChange = isPlayingDidChangeCallback;
+    uiClient.base.version = 5;
     uiClient.decidePolicyForUserMediaPermissionRequest = decidePolicyForUserMediaPermissionRequestCallBack;
 
-    PlatformWebView webView(context.get(), pageGroup.get());
     WKPageSetPageUIClient(webView.page(), &uiClient.base);
-    WKPageSetPageLoaderClient(webView.page(), &loaderClient.base);
 
+    done = false;
     auto url = "" "html"));
-    ASSERT(url.get());
     WKPageLoadURL(webView.page(), url.get());
-    Util::run(&didFinishLoad);
 
-    WKMediaState captureState = WKPageGetMediaState(webView.page());
-    EXPECT_FALSE(captureState & kWKMediaHasActiveVideoCaptureDevice);
-    EXPECT_FALSE(captureState & kWKMediaHasActiveAudioCaptureDevice);
-
-    WKPageRunJavaScriptInMainFrame(webView.page(), Util::toWK("requestAccess()").get(), 0, nullJavaScriptCallback);
-    Util::run(&wasPrompted);
-
-    captureState = WKPageGetMediaState(webView.page());
-    if (!(captureState & kWKMediaHasActiveVideoCaptureDevice)) {
-        Util::run(&isPlayingChanged);
-        captureState = WKPageGetMediaState(webView.page());
-    }
-
-    EXPECT_TRUE(captureState & kWKMediaHasActiveVideoCaptureDevice);
-    EXPECT_FALSE(captureState & kWKMediaHasActiveAudioCaptureDevice);
-
-    isPlayingChanged = false;
-    WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("simple", "html")).get());
-    Util::run(&isPlayingChanged);
-
-    captureState = WKPageGetMediaState(webView.page());
-    EXPECT_FALSE(captureState & kWKMediaHasActiveVideoCaptureDevice);
-    EXPECT_FALSE(captureState & kWKMediaHasActiveAudioCaptureDevice);
+    Util::run(&done);
 }
 
 } // namespace TestWebKitAPI

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html (213286 => 213287)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html	2017-03-02 18:14:55 UTC (rev 213286)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/getUserMedia.html	2017-03-02 18:19:41 UTC (rev 213287)
@@ -1,15 +1,14 @@
-<html>
-    <head>
-        <script>
-            function requestAccess()
-            {
-                var options = { audio: false, video: true };
-                navigator.mediaDevices.getUserMedia(options)
-                    .then(stream => { console.log("Got user media"); })
-                    .catch(error => { console.log(error); });
-            }
-        </script>
-    </head>
-    <body>
-    </body>
-</html>
+<script>
+function gotUserMedia(mediaStream)
+{
+    console.log("Got user media");
+}
+
+function userMediaError(error)
+{
+    console.log(error);
+}
+
+var options = { audio: false, video: true};
+navigator.webkitGetUserMedia(options, gotUserMedia, userMediaError);
+</script>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to