Merged from http://go/wvgerrit/44803. Upgrade HIDL service to v1.1 and implements new 1.1 media API. Test: Netflix and Play Movies & TV streaming and offline playback Test: GTS WidevineH264PlaybackTests test e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases --test com.google.android.media.gts.WidevineH264PlaybackTests#testL1With480P30 Test: GTS MediaDrmTest tests e.g. ANDROID_BUILD_TOP= ./android-gts/tools/gts-tradefed run gts -m GtsMediaTestCases --test com.google.android.media.gts.MediaDrmTest#testWidevineApi28 Test: unit tests bug: 69674645 Change-Id: I91e7e43f9178b61a531e846beffb5f5c17050a3c
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
/*
|
|
* Copyright 2012 Google Inc. All Rights Reserved.
|
|
*/
|
|
|
|
#include "gtest/gtest.h"
|
|
#include "WVCryptoFactory.h"
|
|
|
|
namespace wvdrm {
|
|
namespace hardware {
|
|
namespace drm {
|
|
namespace V1_1 {
|
|
namespace widevine {
|
|
|
|
using wvdrm::hardware::drm::V1_1::widevine::WVCryptoFactory;
|
|
using ::android::sp;
|
|
|
|
const uint8_t kWidevineUUID[16] = {
|
|
0xED,0xEF,0x8B,0xA9,0x79,0xD6,0x4A,0xCE,
|
|
0xA3,0xC8,0x27,0xDC,0xD5,0x1D,0x21,0xED
|
|
};
|
|
|
|
const uint8_t kOldNetflixWidevineUUID[16] = {
|
|
0x29,0x70,0x1F,0xE4,0x3C,0xC7,0x4A,0x34,
|
|
0x8C,0x5B,0xAE,0x90,0xC7,0x43,0x9A,0x47
|
|
};
|
|
|
|
const uint8_t kUnknownUUID[16] = {
|
|
0x6A,0x7F,0xAA,0xB0,0x83,0xC7,0x9E,0x20,
|
|
0x08,0xBC,0xEF,0x32,0x34,0x1A,0x9A,0x26
|
|
};
|
|
|
|
TEST(WVCryptoFactoryTest, SupportsSupportedCryptoSchemes) {
|
|
sp<WVCryptoFactory> factory(new WVCryptoFactory());
|
|
|
|
EXPECT_TRUE(factory->isCryptoSchemeSupported(kWidevineUUID)) <<
|
|
"WVPluginFactory does not support Widevine's UUID";
|
|
|
|
EXPECT_TRUE(factory->isCryptoSchemeSupported(kOldNetflixWidevineUUID)) <<
|
|
"WVPluginFactory does not support the old Netflix Widevine UUID";
|
|
}
|
|
|
|
TEST(WVCryptoFactoryTest, DoesNotSupportUnsupportedCryptoSchemes) {
|
|
sp<WVCryptoFactory> factory(new WVCryptoFactory());
|
|
|
|
EXPECT_FALSE(factory->isCryptoSchemeSupported(kUnknownUUID)) <<
|
|
"WVPluginFactory incorrectly claims to support an unknown UUID";
|
|
}
|
|
|
|
} // namespace widevine
|
|
} // namespace V1_1
|
|
} // namespace drm
|
|
} // namespace hardware
|
|
} // namespace wvdrm
|