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

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

Issue 1016483002: Don't attempt playback if not possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 const std::string& media_type) { 409 const std::string& media_type) {
410 RunSimpleEncryptedMediaTest(encrypted_media, 410 RunSimpleEncryptedMediaTest(encrypted_media,
411 media_type, 411 media_type,
412 CurrentKeySystem(), 412 CurrentKeySystem(),
413 CurrentSourceType(), 413 CurrentSourceType(),
414 CurrentEmeVersion()); 414 CurrentEmeVersion());
415 } 415 }
416 416
417 void TestMultiplePlayback(const std::string& encrypted_media, 417 void TestMultiplePlayback(const std::string& encrypted_media,
418 const std::string& media_type) { 418 const std::string& media_type) {
419 // TestSimplePlayback() checks for KEY_ERROR if playback is not possible.
ddorwin 2015/03/16 19:17:47 Instead, I would follow the pattern at line 596.
jrummell 2015/03/16 20:13:06 Done.
420 // Since this just runs playback twice, don't waste time if playback not
421 // possible.
422 if (!IsPlayBackPossible(CurrentKeySystem()))
423 return;
424
419 RunEncryptedMediaTest(kDefaultEmePlayer, encrypted_media, media_type, 425 RunEncryptedMediaTest(kDefaultEmePlayer, encrypted_media, media_type,
420 CurrentKeySystem(), CurrentSourceType(), 426 CurrentKeySystem(), CurrentSourceType(),
421 CurrentEmeVersion(), kNoSessionToLoad, false, 427 CurrentEmeVersion(), kNoSessionToLoad, false,
422 PlayTwice::YES, kEnded); 428 PlayTwice::YES, kEnded);
423 } 429 }
424 430
425 void RunInvalidResponseTest() { 431 void RunInvalidResponseTest() {
426 RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-av_enc-av.webm", 432 RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-av_enc-av.webm",
427 kWebMAudioVideo, CurrentKeySystem(), 433 kWebMAudioVideo, CurrentKeySystem(),
428 CurrentSourceType(), CurrentEmeVersion(), 434 CurrentSourceType(), CurrentEmeVersion(),
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 715
710 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) { 716 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) {
711 TestPlaybackCase(kLoadableSession, kEnded); 717 TestPlaybackCase(kLoadableSession, kEnded);
712 } 718 }
713 719
714 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) { 720 IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) {
715 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. 721 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound.
716 TestPlaybackCase(kUnknownSession, kEmeKeyError); 722 TestPlaybackCase(kUnknownSession, kEmeKeyError);
717 } 723 }
718 #endif // defined(ENABLE_PEPPER_CDMS) 724 #endif // defined(ENABLE_PEPPER_CDMS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698