Title: [174667] trunk/Tools
Revision
174667
Author
[email protected]
Date
2014-10-13 18:16:25 -0700 (Mon, 13 Oct 2014)

Log Message

MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=137533

Reviewed by Andy Estes.

Follow up patch; bail out of the test early (without failing) if the platform does not support MSE.

* TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp:
(TestWebKitAPI::isMSEEnabledCallback):
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (174666 => 174667)


--- trunk/Tools/ChangeLog	2014-10-14 00:22:49 UTC (rev 174666)
+++ trunk/Tools/ChangeLog	2014-10-14 01:16:25 UTC (rev 174667)
@@ -1,3 +1,16 @@
+2014-10-13  Jer Noble  <[email protected]>
+
+        MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
+        https://bugs.webkit.org/show_bug.cgi?id=137533
+
+        Reviewed by Andy Estes.
+
+        Follow up patch; bail out of the test early (without failing) if the platform does not support MSE.
+
+        * TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp:
+        (TestWebKitAPI::isMSEEnabledCallback):
+        (TestWebKitAPI::TEST):
+
 2014-10-13  Brent Fulgham  <[email protected]>
 
         [Win] Implement a page load profiling tool

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp (174666 => 174667)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp	2014-10-14 00:22:49 UTC (rev 174666)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp	2014-10-14 01:16:25 UTC (rev 174667)
@@ -27,6 +27,9 @@
 #include "PlatformUtilities.h"
 #include "PlatformWebView.h"
 #include "Test.h"
+#include <_javascript_Core/JSRetainPtr.h>
+#include <_javascript_Core/_javascript_Core.h>
+#include <WebKit/WKSerializedScriptValue.h>
 #include <WebKit/WKPagePrivate.h>
 #include <WebKit/WKPreferencesRef.h>
 #include <WebKit/WKPreferencesRefPrivate.h>
@@ -38,6 +41,8 @@
 
 namespace TestWebKitAPI {
 
+static bool isMSEEnabledChanged;
+static bool isMSEEnabled;
 static bool didFinishLoad;
 static bool isPlayingAudioChanged;
 
@@ -45,6 +50,19 @@
 {
 }
 
+static void isMSEEnabledCallback(WKSerializedScriptValueRef serializedResultValue, WKErrorRef error, void*)
+{
+    JSGlobalContextRef scriptContext = JSGlobalContextCreate(0);
+
+    JSValueRef resultValue = WKSerializedScriptValueDeserialize(serializedResultValue, scriptContext, 0);
+    EXPECT_TRUE(JSValueIsBoolean(scriptContext, resultValue));
+
+    isMSEEnabledChanged = true;
+    isMSEEnabled = JSValueToBoolean(scriptContext, resultValue);
+
+    JSGlobalContextRelease(scriptContext);
+}
+
 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef, WKTypeRef, const void*)
 {
     didFinishLoad = true;
@@ -111,6 +129,13 @@
 
     Util::run(&didFinishLoad);
 
+    // Bail out of the test early if the platform does not support MSE.
+    isMSEEnabledChanged = false;
+    WKPageRunJavaScriptInMainFrame(webView.page(), Util::toWK("window.MediaSource !== undefined").get(), 0, isMSEEnabledCallback);
+    Util::run(&isMSEEnabledChanged);
+    if (!isMSEEnabled)
+        return;
+
     EXPECT_FALSE(WKPageIsPlayingAudio(webView.page()));
     isPlayingAudioChanged = false;
     WKPageRunJavaScriptInMainFrame(webView.page(), Util::toWK("playVideo()").get(), 0, nullJavaScriptCallback);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to