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

Side by Side Diff: content/browser/media/encrypted_media_browsertest.cc

Issue 642813012: Reland "Add unprefixed EME tests for LoadSession()" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: rebase Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 base::StringPairs 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 query_params.push_back(std::make_pair("usePrefixedEME", "1"));
86 RunMediaTestPage("mse_config_change.html", query_params, kEnded, true); 87 RunMediaTestPage("mse_config_change.html", query_params, kEnded, true);
87 } 88 }
88 89
89 void RunEncryptedMediaTest(const std::string& html_page, 90 void RunEncryptedMediaTest(const std::string& html_page,
90 const std::string& media_file, 91 const std::string& media_file,
91 const std::string& media_type, 92 const std::string& media_type,
92 const std::string& key_system, 93 const std::string& key_system,
93 SrcType src_type, 94 SrcType src_type,
94 const std::string& expectation) { 95 const std::string& expectation) {
95 #if defined(OS_ANDROID) && defined(__aarch64__) 96 #if defined(OS_ANDROID) && defined(__aarch64__)
96 // Disable EME tests on arm64 due to timeouts: http://crbug.com/418039 97 // Disable EME tests on arm64 due to timeouts: http://crbug.com/418039
97 return; 98 return;
98 #endif 99 #endif
99 if (src_type == MSE && !IsMSESupported()) { 100 if (src_type == MSE && !IsMSESupported()) {
100 VLOG(0) << "Skipping test - MSE not supported."; 101 VLOG(0) << "Skipping test - MSE not supported.";
101 return; 102 return;
102 } 103 }
103 104
104 base::StringPairs query_params; 105 base::StringPairs query_params;
105 query_params.push_back(std::make_pair("mediaFile", media_file)); 106 query_params.push_back(std::make_pair("mediaFile", media_file));
106 query_params.push_back(std::make_pair("mediaType", media_type)); 107 query_params.push_back(std::make_pair("mediaType", media_type));
107 query_params.push_back(std::make_pair("keySystem", key_system)); 108 query_params.push_back(std::make_pair("keySystem", key_system));
108 if (src_type == MSE) 109 if (src_type == MSE)
109 query_params.push_back(std::make_pair("useMSE", "1")); 110 query_params.push_back(std::make_pair("useMSE", "1"));
111 query_params.push_back(std::make_pair("usePrefixedEME", "1"));
110 RunMediaTestPage(html_page, query_params, expectation, true); 112 RunMediaTestPage(html_page, query_params, expectation, true);
111 } 113 }
112 114
113 void RunSimpleEncryptedMediaTest(const std::string& media_file, 115 void RunSimpleEncryptedMediaTest(const std::string& media_file,
114 const std::string& media_type, 116 const std::string& media_type,
115 const std::string& key_system, 117 const std::string& key_system,
116 SrcType src_type) { 118 SrcType src_type) {
117 RunEncryptedMediaTest(kDefaultEmePlayer, 119 RunEncryptedMediaTest(kDefaultEmePlayer,
118 media_file, 120 media_file,
119 media_type, 121 media_type,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { 188 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) {
187 RunEncryptedMediaTest(kDefaultEmePlayer, 189 RunEncryptedMediaTest(kDefaultEmePlayer,
188 "bear-a_enc-a.webm", 190 "bear-a_enc-a.webm",
189 kWebMAudioOnly, 191 kWebMAudioOnly,
190 "com.example.foo", 192 "com.example.foo",
191 MSE, 193 MSE,
192 kEmeNotSupportedError); 194 kEmeNotSupportedError);
193 } 195 }
194 196
195 } // namespace content 197 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/media/encrypted_media_browsertest.cc ('k') | content/browser/media/media_source_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698