[WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Sep 2017 10:32:49 +0000 (10:32 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Sep 2017 10:32:49 +0000 (10:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177312

Reviewed by Carlos Garcia Campos.

Source/WebKit:

When enabling EME through the InjectedBundle for testing purposes, it's
only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
This causes failures on imported W3C tests that cover EME persistent
state licenses and perform parts of that test in a new window, where
the original RuntimeEnabledFeatures state doesn't have any effect.

To avoid those failures, when enabling EME feature for testing purposes
through InjectedBundle, the feature should also be enabled in the
WebPreferencesStore.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

LayoutTests:

Update test baselines for two tests that now properly execute (even if
they still fail) due to EME setting now also being updated in
WebPreferencesStore.

* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222432 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt
LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp

index f428ff1..b7962b7 100644 (file)
@@ -1,3 +1,17 @@
+2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
+
+        [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
+        https://bugs.webkit.org/show_bug.cgi?id=177312
+
+        Reviewed by Carlos Garcia Campos.
+
+        Update test baselines for two tests that now properly execute (even if
+        they still fail) due to EME setting now also being updated in
+        WebPreferencesStore.
+
+        * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt:
+        * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt:
+
 2017-09-22  Antti Koivisto  <antti@apple.com>
 
         Remove tests for CSS Regions
index 5673666..6ba4bf1 100644 (file)
@@ -1,6 +1,3 @@
-CONSOLE MESSAGE: line 81: TypeError: navigator.requestMediaKeySystemAccess is not a function. (In 'navigator.requestMediaKeySystemAccess(config.keysystem, [ configuration ] )', 'navigator.requestMediaKeySystemAccess' is undefined)
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT org.w3.clearkey, persistent-license, mp4, playback, retrieve, playback and destroy Test timed out
+FAIL org.w3.clearkey, persistent-license, mp4, playback, retrieve, playback and destroy assert_equals: NotSupportedError: The operation is not supported. expected true but got false
 
index b76e467..eda4a51 100644 (file)
@@ -1,6 +1,3 @@
-CONSOLE MESSAGE: line 53: TypeError: navigator.requestMediaKeySystemAccess is not a function. (In 'navigator.requestMediaKeySystemAccess(config.keysystem, [ configuration ] )', 'navigator.requestMediaKeySystemAccess' is undefined)
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT org.w3.clearkey, persistent-license, mp4, playback, retrieve and playback Test timed out
+FAIL org.w3.clearkey, persistent-license, mp4, playback, retrieve and playback assert_equals: NotSupportedError: The operation is not supported. expected true but got false
 
index 40bf5f4..3560521 100644 (file)
@@ -1,3 +1,23 @@
+2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
+
+        [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
+        https://bugs.webkit.org/show_bug.cgi?id=177312
+
+        Reviewed by Carlos Garcia Campos.
+
+        When enabling EME through the InjectedBundle for testing purposes, it's
+        only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
+        This causes failures on imported W3C tests that cover EME persistent
+        state licenses and perform parts of that test in a new window, where
+        the original RuntimeEnabledFeatures state doesn't have any effect.
+
+        To avoid those failures, when enabling EME feature for testing purposes
+        through InjectedBundle, the feature should also be enabled in the
+        WebPreferencesStore.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
 2017-09-22  Zalan Bujtas  <zalan@apple.com>
 
         WeakPtrFactory should populate m_ref lazily.
index a1a646d..93dae41 100644 (file)
@@ -215,8 +215,10 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
         RuntimeEnabledFeatures::sharedFeatures().setModernMediaControlsEnabled(enabled);
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    if (preference == "WebKitEncryptedMediaAPIEnabled")
+    if (preference == "WebKitEncryptedMediaAPIEnabled") {
+        WebPreferencesStore::overrideBoolValueForKey(WebPreferencesKey::encryptedMediaAPIEnabledKey(), enabled);
         RuntimeEnabledFeatures::sharedFeatures().setEncryptedMediaAPIEnabled(enabled);
+    }
 #endif
 
 #if ENABLE(MEDIA_STREAM)