Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / renderer / media / crypto / key_systems_unittest.cc
index e52d361..d7c980d 100644 (file)
@@ -7,9 +7,10 @@
 
 #include "content/public/common/content_client.h"
 #include "content/public/renderer/content_renderer_client.h"
-#include "content/public/renderer/key_system_info.h"
 #include "content/renderer/media/crypto/key_systems.h"
 #include "content/test/test_content_client.h"
+#include "media/base/eme_constants.h"
+#include "media/base/key_system_info.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/public/platform/WebString.h"
 
@@ -36,6 +37,7 @@
 namespace content {
 
 using blink::WebString;
+using media::KeySystemInfo;
 
 // These are the (fake) key systems that are registered for these tests.
 // kUsesAes uses the AesDecryptor like Clear Key.
@@ -64,8 +66,9 @@ enum TestCodec {
   TEST_CODEC_FOO_ALL = TEST_CODEC_FOO_AUDIO_ALL | TEST_CODEC_FOO_VIDEO_ALL
 };
 
-COMPILE_ASSERT((TEST_CODEC_FOO_ALL & EME_CODEC_ALL) == EME_CODEC_NONE,
-                test_codec_masks_should_only_use_invalid_codec_masks);
+COMPILE_ASSERT((TEST_CODEC_FOO_ALL & media::EME_CODEC_ALL) ==
+                   media::EME_CODEC_NONE,
+               test_codec_masks_should_only_use_invalid_codec_masks);
 
 // Adds test container and codec masks.
 // This function must be called after SetContentClient() is called.
@@ -91,21 +94,22 @@ static void AddContainerAndCodecMasksForTest() {
 }
 
 class TestContentRendererClient : public ContentRendererClient {
-  virtual void AddKeySystems(
-      std::vector<content::KeySystemInfo>* key_systems) OVERRIDE;
+  void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;
 };
 
 void TestContentRendererClient::AddKeySystems(
-    std::vector<content::KeySystemInfo>* key_systems) {
+    std::vector<media::KeySystemInfo>* key_systems) {
   KeySystemInfo aes(kUsesAes);
-  aes.supported_codecs = EME_CODEC_WEBM_ALL;
+  aes.supported_codecs = media::EME_CODEC_WEBM_ALL;
   aes.supported_codecs |= TEST_CODEC_FOO_ALL;
+  aes.supported_init_data_types = media::EME_INIT_DATA_TYPE_WEBM;
   aes.use_aes_decryptor = true;
   key_systems->push_back(aes);
 
   KeySystemInfo ext(kExternal);
-  ext.supported_codecs = EME_CODEC_WEBM_ALL;
+  ext.supported_codecs = media::EME_CODEC_WEBM_ALL;
   ext.supported_codecs |= TEST_CODEC_FOO_ALL;
+  ext.supported_init_data_types = media::EME_INIT_DATA_TYPE_WEBM;
   ext.parent_key_system = kExternalParent;
 #if defined(ENABLE_PEPPER_CDMS)
   ext.pepper_type = "application/x-ppapi-external-cdm";
@@ -113,6 +117,7 @@ void TestContentRendererClient::AddKeySystems(
   key_systems->push_back(ext);
 }
 
+// TODO(sandersd): Refactor. http://crbug.com/417444
 class KeySystemsTest : public testing::Test {
  protected:
   KeySystemsTest() {
@@ -159,11 +164,9 @@ class KeySystemsTest : public testing::Test {
     SetRendererClientForTesting(&content_renderer_client_);
   }
 
-  virtual void SetUp() OVERRIDE {
-    AddContainerAndCodecMasksForTest();
-  }
+  void SetUp() override { AddContainerAndCodecMasksForTest(); }
 
-  virtual ~KeySystemsTest() {
+  ~KeySystemsTest() override {
     // Clear the use of content_client_, which was set in SetUp().
     SetContentClient(NULL);
   }