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

Side by Side Diff: media/base/key_systems_unittest.cc

Issue 1014733002: Implement support for "keyids" Initialization Data format (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 | « media/base/key_systems.cc ('k') | 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/base/eme_constants.h" 9 #include "media/base/eme_constants.h"
10 #include "media/base/key_system_info.h" 10 #include "media/base/key_system_info.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 EXPECT_EQ("ClearKey", GetKeySystemNameForUMA(kClearKey)); 348 EXPECT_EQ("ClearKey", GetKeySystemNameForUMA(kClearKey));
349 349
350 // Prefixed Clear Key is not supported internally. 350 // Prefixed Clear Key is not supported internally.
351 EXPECT_FALSE(IsSupportedKeySystem(kPrefixedClearKey)); 351 EXPECT_FALSE(IsSupportedKeySystem(kPrefixedClearKey));
352 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 352 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
353 kVideoWebM, no_codecs(), kPrefixedClearKey)); 353 kVideoWebM, no_codecs(), kPrefixedClearKey));
354 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kPrefixedClearKey)); 354 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kPrefixedClearKey));
355 } 355 }
356 356
357 TEST_F(KeySystemsTest, ClearKeyWithInitDataType) {
358 EXPECT_TRUE(IsSupportedKeySystem(kClearKey));
359 EXPECT_TRUE(IsSupportedKeySystemWithInitDataType(kClearKey, "webm"));
360 EXPECT_TRUE(IsSupportedKeySystemWithInitDataType(kClearKey, "keyids"));
361
362 // All other InitDataTypes are not supported.
363 EXPECT_FALSE(IsSupportedKeySystemWithInitDataType(kClearKey, "unknown"));
364 }
365
357 // The key system is not registered and therefore is unrecognized. 366 // The key system is not registered and therefore is unrecognized.
358 TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) { 367 TEST_F(KeySystemsTest, Basic_UnrecognizedKeySystem) {
359 static const char* const kUnrecognized = "x-org.example.unrecognized"; 368 static const char* const kUnrecognized = "x-org.example.unrecognized";
360 369
361 EXPECT_FALSE(IsSupportedKeySystem(kUnrecognized)); 370 EXPECT_FALSE(IsSupportedKeySystem(kUnrecognized));
362 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( 371 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType(
363 kVideoWebM, no_codecs(), kUnrecognized)); 372 kVideoWebM, no_codecs(), kUnrecognized));
364 373
365 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUnrecognized)); 374 EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kUnrecognized));
366 375
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else")); 865 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.something.else"));
857 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other")); 866 EXPECT_FALSE(IsSupportedKeySystem("com.chromecast.other"));
858 867
859 EXPECT_FALSE(IsSupportedKeySystem("x-")); 868 EXPECT_FALSE(IsSupportedKeySystem("x-"));
860 EXPECT_TRUE(IsSupportedKeySystem("x-something")); 869 EXPECT_TRUE(IsSupportedKeySystem("x-something"));
861 EXPECT_FALSE(IsSupportedKeySystem("x-something.else")); 870 EXPECT_FALSE(IsSupportedKeySystem("x-something.else"));
862 EXPECT_FALSE(IsSupportedKeySystem("x-other")); 871 EXPECT_FALSE(IsSupportedKeySystem("x-other"));
863 } 872 }
864 873
865 } // namespace media 874 } // namespace media
OLDNEW
« no previous file with comments | « media/base/key_systems.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698