Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1756)

Unified Diff: chrome/browser/media/encrypted_media_browsertest.cc

Issue 2676633006: media: Add a web preference to enable encrypted media (Closed)
Patch Set: use a new pref Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/encrypted_media_browsertest.cc
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
index 4ffa8f4c12a7902a34a5ae7d65ceaf08c9b42b21..09872a7397ef44fc477fa27062c25b4066b50ea6 100644
--- a/chrome/browser/media/encrypted_media_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -12,10 +12,13 @@
#include "chrome/browser/media/media_browsertest.h"
#include "chrome/browser/media/test_license_server.h"
#include "chrome/browser/media/wv_test_license_server_config.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/test_launcher_utils.h"
+#include "components/prefs/pref_service.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "media/base/media_switches.h"
@@ -415,6 +418,11 @@ class EncryptedMediaTest : public EncryptedMediaTestBase,
CurrentKeySystem(), query_params, kEnded);
}
+ void DisableEncryptedMedia() {
+ PrefService* pref_service = browser()->profile()->GetPrefs();
+ pref_service->SetBoolean(prefs::kWebKitEncryptedMediaEnabled, false);
+ }
+
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
EncryptedMediaTestBase::SetUpCommandLine(command_line);
@@ -536,6 +544,14 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, FrameSizeChangeVideo) {
TestFrameSizeChange();
}
+IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, EncryptedMediaDisabled) {
+ DisableEncryptedMedia();
+ RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm",
+ kWebMVorbisAudioOnly, CurrentKeySystem(),
+ CurrentSourceType(), kNoSessionToLoad, false,
+ PlayCount::ONCE, kEmeNotSupportedError);
+}
+
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
// Crashes on Mac only. http://crbug.com/621857
#if defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/ui/prefs/prefs_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698