OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome/browser/media/media_browsertest.h" | 10 #include "chrome/browser/media/media_browsertest.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 return config.Pass(); | 221 return config.Pass(); |
222 } | 222 } |
223 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 223 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
224 return scoped_ptr<TestLicenseServerConfig>(); | 224 return scoped_ptr<TestLicenseServerConfig>(); |
225 } | 225 } |
226 | 226 |
227 protected: | 227 protected: |
228 scoped_ptr<TestLicenseServer> license_server_; | 228 scoped_ptr<TestLicenseServer> license_server_; |
229 | 229 |
230 // We want to fail quickly when a test fails because an error is encountered. | 230 // We want to fail quickly when a test fails because an error is encountered. |
231 virtual void AddWaitForTitles(content::TitleWatcher* title_watcher) OVERRIDE { | 231 virtual void AddWaitForTitles(content::TitleWatcher* title_watcher) override { |
232 MediaBrowserTest::AddWaitForTitles(title_watcher); | 232 MediaBrowserTest::AddWaitForTitles(title_watcher); |
233 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); | 233 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); |
234 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); | 234 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); |
235 } | 235 } |
236 | 236 |
237 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 237 virtual void SetUpCommandLine(CommandLine* command_line) override { |
238 #if defined(OS_ANDROID) | 238 #if defined(OS_ANDROID) |
239 command_line->AppendSwitch( | 239 command_line->AppendSwitch( |
240 switches::kDisableGestureRequirementForMediaPlayback); | 240 switches::kDisableGestureRequirementForMediaPlayback); |
241 #endif // defined(OS_ANDROID) | 241 #endif // defined(OS_ANDROID) |
242 } | 242 } |
243 | 243 |
244 void SetUpCommandLineForKeySystem(const std::string& key_system, | 244 void SetUpCommandLineForKeySystem(const std::string& key_system, |
245 CommandLine* command_line) { | 245 CommandLine* command_line) { |
246 if (GetServerConfig(key_system)) | 246 if (GetServerConfig(key_system)) |
247 // Since the web and license servers listen on different ports, we need to | 247 // Since the web and license servers listen on different ports, we need to |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 kWebMAudioOnly, | 319 kWebMAudioOnly, |
320 key_system, | 320 key_system, |
321 SRC, | 321 SRC, |
322 PREFIXED, | 322 PREFIXED, |
323 kNoSessionToLoad, | 323 kNoSessionToLoad, |
324 false, | 324 false, |
325 expected_title); | 325 expected_title); |
326 } | 326 } |
327 | 327 |
328 protected: | 328 protected: |
329 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 329 virtual void SetUpCommandLine(CommandLine* command_line) override { |
330 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 330 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
331 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); | 331 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
332 } | 332 } |
333 }; | 333 }; |
334 | 334 |
335 #if defined(WIDEVINE_CDM_AVAILABLE) | 335 #if defined(WIDEVINE_CDM_AVAILABLE) |
336 // Tests encrypted media playback using Widevine key system. | 336 // Tests encrypted media playback using Widevine key system. |
337 class WVEncryptedMediaTest : public EncryptedMediaTestBase { | 337 class WVEncryptedMediaTest : public EncryptedMediaTestBase { |
338 protected: | 338 protected: |
339 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 339 virtual void SetUpCommandLine(CommandLine* command_line) override { |
340 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 340 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
341 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | 341 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
342 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); | 342 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); |
343 } | 343 } |
344 }; | 344 }; |
345 | 345 |
346 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 346 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
347 #endif // defined(ENABLE_PEPPER_CDMS) | 347 #endif // defined(ENABLE_PEPPER_CDMS) |
348 | 348 |
349 // Tests encrypted media playback with a combination of parameters: | 349 // Tests encrypted media playback with a combination of parameters: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 query_params.push_back(std::make_pair("runEncrypted", "1")); | 411 query_params.push_back(std::make_pair("runEncrypted", "1")); |
412 if (CurrentEmeVersion() == PREFIXED) | 412 if (CurrentEmeVersion() == PREFIXED) |
413 query_params.push_back(std::make_pair("usePrefixedEME", "1")); | 413 query_params.push_back(std::make_pair("usePrefixedEME", "1")); |
414 RunEncryptedMediaTestPage("mse_config_change.html", | 414 RunEncryptedMediaTestPage("mse_config_change.html", |
415 CurrentKeySystem(), | 415 CurrentKeySystem(), |
416 query_params, | 416 query_params, |
417 kEnded); | 417 kEnded); |
418 } | 418 } |
419 | 419 |
420 protected: | 420 protected: |
421 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 421 virtual void SetUpCommandLine(CommandLine* command_line) override { |
422 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 422 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
423 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); | 423 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); |
424 | 424 |
425 if (CurrentEmeVersion() == UNPREFIXED) | 425 if (CurrentEmeVersion() == UNPREFIXED) |
426 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | 426 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
427 } | 427 } |
428 }; | 428 }; |
429 | 429 |
430 using ::testing::Combine; | 430 using ::testing::Combine; |
431 using ::testing::Values; | 431 using ::testing::Values; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 "bear-320x240-v_enc-v.webm", | 660 "bear-320x240-v_enc-v.webm", |
661 kWebMVideoOnly, | 661 kWebMVideoOnly, |
662 kExternalClearKeyKeySystem, | 662 kExternalClearKeyKeySystem, |
663 SRC, | 663 SRC, |
664 PREFIXED, | 664 PREFIXED, |
665 kUnknownSession, | 665 kUnknownSession, |
666 false, | 666 false, |
667 kEmeKeyError); | 667 kEmeKeyError); |
668 } | 668 } |
669 #endif // defined(ENABLE_PEPPER_CDMS) | 669 #endif // defined(ENABLE_PEPPER_CDMS) |
OLD | NEW |