| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
| 8 #include "content/browser/media/media_browsertest.h" | 8 #include "content/browser/media/media_browsertest.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 "frame_size_change-av_enc-v.webm", kWebMAudioVideo, | 73 "frame_size_change-av_enc-v.webm", kWebMAudioVideo, |
| 74 CurrentKeySystem(), CurrentSourceType(), kEnded); | 74 CurrentKeySystem(), CurrentSourceType(), kEnded); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void TestConfigChange() { | 77 void TestConfigChange() { |
| 78 if (CurrentSourceType() != MSE || !IsMSESupported()) { | 78 if (CurrentSourceType() != MSE || !IsMSESupported()) { |
| 79 VLOG(0) << "Skipping test - config change test requires MSE."; | 79 VLOG(0) << "Skipping test - config change test requires MSE."; |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 | 82 |
| 83 media::QueryParams query_params; | 83 base::StringPairs query_params; |
| 84 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); | 84 query_params.push_back(std::make_pair("keySystem", CurrentKeySystem())); |
| 85 query_params.push_back(std::make_pair("runEncrypted", "1")); | 85 query_params.push_back(std::make_pair("runEncrypted", "1")); |
| 86 RunMediaTestPage("mse_config_change.html", query_params, kEnded, true); | 86 RunMediaTestPage("mse_config_change.html", query_params, kEnded, true); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void RunEncryptedMediaTest(const std::string& html_page, | 89 void RunEncryptedMediaTest(const std::string& html_page, |
| 90 const std::string& media_file, | 90 const std::string& media_file, |
| 91 const std::string& media_type, | 91 const std::string& media_type, |
| 92 const std::string& key_system, | 92 const std::string& key_system, |
| 93 SrcType src_type, | 93 SrcType src_type, |
| 94 const std::string& expectation) { | 94 const std::string& expectation) { |
| 95 if (src_type == MSE && !IsMSESupported()) { | 95 if (src_type == MSE && !IsMSESupported()) { |
| 96 VLOG(0) << "Skipping test - MSE not supported."; | 96 VLOG(0) << "Skipping test - MSE not supported."; |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 | 99 |
| 100 media::QueryParams query_params; | 100 base::StringPairs query_params; |
| 101 query_params.push_back(std::make_pair("mediaFile", media_file)); | 101 query_params.push_back(std::make_pair("mediaFile", media_file)); |
| 102 query_params.push_back(std::make_pair("mediaType", media_type)); | 102 query_params.push_back(std::make_pair("mediaType", media_type)); |
| 103 query_params.push_back(std::make_pair("keySystem", key_system)); | 103 query_params.push_back(std::make_pair("keySystem", key_system)); |
| 104 if (src_type == MSE) | 104 if (src_type == MSE) |
| 105 query_params.push_back(std::make_pair("useMSE", "1")); | 105 query_params.push_back(std::make_pair("useMSE", "1")); |
| 106 RunMediaTestPage(html_page, query_params, expectation, true); | 106 RunMediaTestPage(html_page, query_params, expectation, true); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void RunSimpleEncryptedMediaTest(const std::string& media_file, | 109 void RunSimpleEncryptedMediaTest(const std::string& media_file, |
| 110 const std::string& media_type, | 110 const std::string& media_type, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { | 185 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { |
| 186 RunEncryptedMediaTest(kDefaultEmePlayer, | 186 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 187 "bear-a_enc-a.webm", | 187 "bear-a_enc-a.webm", |
| 188 kWebMAudioOnly, | 188 kWebMAudioOnly, |
| 189 "com.example.foo", | 189 "com.example.foo", |
| 190 MSE, | 190 MSE, |
| 191 kEmeNotSupportedError); | 191 kEmeNotSupportedError); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace content | 194 } // namespace content |
| OLD | NEW |