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 40a73b473f1fddfd70cc6a19d97fdeea569bded4..65a728076a0a7c483330795c61dd9399d5011ccb 100644 |
--- a/chrome/browser/media/encrypted_media_browsertest.cc |
+++ b/chrome/browser/media/encrypted_media_browsertest.cc |
@@ -115,12 +115,14 @@ class EncryptedMediaTestBase : public MediaBrowserTest { |
} |
#endif // defined(WIDEVINE_CDM_AVAILABLE) |
- void RunEncryptedMediaTestPage(const std::string& html_page, |
- const std::string& key_system, |
- std::vector<StringPair>* query_params, |
- const std::string& expected_title) { |
- StartLicenseServerIfNeeded(key_system, query_params); |
- RunMediaTestPage(html_page, query_params, expected_title, true); |
+ void RunEncryptedMediaTestPage( |
+ const std::string& html_page, |
+ const std::string& key_system, |
+ const media::QueryParams& query_params, |
+ const std::string& expected_title) { |
+ media::QueryParams new_query_params = query_params; |
+ StartLicenseServerIfNeeded(key_system, &new_query_params); |
+ RunMediaTestPage(html_page, new_query_params, expected_title, true); |
} |
// Tests |html_page| using |media_file| (with |media_type|) and |key_system|. |
@@ -144,7 +146,7 @@ class EncryptedMediaTestBase : public MediaBrowserTest { |
VLOG(0) << "Skipping test - MSE not supported."; |
return; |
} |
- std::vector<StringPair> query_params; |
+ media::QueryParams query_params; |
query_params.push_back(std::make_pair("mediaFile", media_file)); |
query_params.push_back(std::make_pair("mediaType", media_type)); |
query_params.push_back(std::make_pair("keySystem", key_system)); |
@@ -156,7 +158,7 @@ class EncryptedMediaTestBase : public MediaBrowserTest { |
query_params.push_back(std::make_pair("forceInvalidResponse", "1")); |
if (!session_to_load.empty()) |
query_params.push_back(std::make_pair("sessionToLoad", session_to_load)); |
- RunEncryptedMediaTestPage(html_page, key_system, &query_params, |
+ RunEncryptedMediaTestPage(html_page, key_system, query_params, |
expected_title); |
} |
@@ -188,16 +190,17 @@ class EncryptedMediaTestBase : public MediaBrowserTest { |
EXPECT_TRUE(receivedKeyMessage); |
} |
- |
+ // Starts a license server if available for the |key_system| and adds a |
+ // 'licenseServerURL' query parameter to |query_params|. |
void StartLicenseServerIfNeeded(const std::string& key_system, |
- std::vector<StringPair>* query_params) { |
+ media::QueryParams* query_params) { |
scoped_ptr<TestLicenseServerConfig> config = GetServerConfig(key_system); |
if (!config) |
return; |
license_server_.reset(new TestLicenseServer(config.Pass())); |
EXPECT_TRUE(license_server_->Start()); |
- query_params->push_back(std::make_pair("licenseServerURL", |
- license_server_->GetServerURL())); |
+ query_params->push_back( |
+ std::make_pair("licenseServerURL", license_server_->GetServerURL())); |
} |
bool IsPlayBackPossible(const std::string& key_system) { |
@@ -312,7 +315,7 @@ class ECKEncryptedMediaTest : public EncryptedMediaTestBase { |
// Since we do not test playback, arbitrarily choose a test file and source |
// type. |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-a-enc_a.webm", |
+ "bear-a_enc-a.webm", |
kWebMAudioOnly, |
key_system, |
SRC, |
@@ -379,7 +382,7 @@ class EncryptedMediaTest |
void RunInvalidResponseTest() { |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-320x240-av-enc_av.webm", |
+ "bear-320x240-av_enc-av.webm", |
kWebMAudioVideo, |
CurrentKeySystem(), |
CurrentSourceType(), |
@@ -391,7 +394,7 @@ class EncryptedMediaTest |
void TestFrameSizeChange() { |
RunEncryptedMediaTest("encrypted_frame_size_change.html", |
- "frame_size_change-av-enc-v.webm", |
+ "frame_size_change-av_enc-v.webm", |
kWebMAudioVideo, |
CurrentKeySystem(), |
CurrentSourceType(), |
@@ -403,14 +406,14 @@ class EncryptedMediaTest |
void TestConfigChange() { |
DCHECK(IsMSESupported()); |
- std::vector<StringPair> query_params; |
+ media::QueryParams query_params; |
query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); |
query_params.push_back(std::make_pair("runEncrypted", "1")); |
if (CurrentEmeVersion() == PREFIXED) |
query_params.push_back(std::make_pair("usePrefixedEME", "1")); |
RunEncryptedMediaTestPage("mse_config_change.html", |
CurrentKeySystem(), |
- &query_params, |
+ query_params, |
kEnded); |
} |
@@ -488,7 +491,7 @@ INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly, |
Combine(Values(kExternalClearKeyDecryptOnlyKeySystem), |
Values(MSE), |
Values(UNPREFIXED))); |
-#endif // defined(ENABLE_PEPPER_CDMS) |
+#endif // defined(ENABLE_PEPPER_CDMS) |
#if defined(WIDEVINE_CDM_AVAILABLE) |
// This test doesn't fully test playback with Widevine. So we only run Widevine |
@@ -511,27 +514,27 @@ INSTANTIATE_TEST_CASE_P(MSE_Widevine, |
#endif // defined(WIDEVINE_CDM_AVAILABLE) |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { |
- TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly); |
+ TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { |
- TestSimplePlayback("bear-320x240-av-enc_a.webm", kWebMAudioVideo); |
+ TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { |
- TestSimplePlayback("bear-320x240-av-enc_av.webm", kWebMAudioVideo); |
+ TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { |
- TestSimplePlayback("bear-320x240-v-enc_v.webm", kWebMVideoOnly); |
+ TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { |
- TestSimplePlayback("bear-320x240-av-enc_v.webm", kWebMAudioVideo); |
+ TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VP9Video_WebM) { |
- TestSimplePlayback("bear-320x240-v-vp9-enc_v.webm", kWebMVP9VideoOnly); |
+ TestSimplePlayback("bear-320x240-v-vp9_enc-v.webm", kWebMVP9VideoOnly); |
} |
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, InvalidResponseKeyError) { |
@@ -587,7 +590,7 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_MP4) { |
// The parent key system cannot be used in generateKeyRequest. |
IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) { |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-a-enc_a.webm", |
+ "bear-a_enc-a.webm", |
kWebMAudioOnly, |
"com.widevine", |
MSE, |
@@ -601,7 +604,7 @@ IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) { |
// The parent key system cannot be used when creating MediaKeys. |
IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) { |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-a-enc_a.webm", |
+ "bear-a_enc-a.webm", |
kWebMAudioOnly, |
"com.widevine", |
MSE, |
@@ -640,7 +643,7 @@ IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { |
IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-320x240-v-enc_v.webm", |
+ "bear-320x240-v_enc-v.webm", |
kWebMVideoOnly, |
kExternalClearKeyKeySystem, |
SRC, |
@@ -653,7 +656,7 @@ IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { |
// TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. |
RunEncryptedMediaTest(kDefaultEmePlayer, |
- "bear-320x240-v-enc_v.webm", |
+ "bear-320x240-v_enc-v.webm", |
kWebMVideoOnly, |
kExternalClearKeyKeySystem, |
SRC, |