Files
android/libwvdrmengine/cdm/test/unit-test.mk
Fred Gylys-Colwell 9ff5125867 Adjust CDM engine and request license unit tests
Merge of the widevine change:
https://widevine-internal-review.googlesource.com/#/c/11632

Several unit tests in cdm_engine_test.cpp and request_license_test.cpp
were failing regularly. These were caused by either:
1) The device was not provisioned.
  This has been fixed by adding a certificate provisioning step in the
  test setup for the cdm engine tests and changing the existing
  provision steop in the request license tests to provision for both
  security levels.
2) The device was hitting a flaky server.
  This has been fixed by switching from the GooglePlayServer to the
  Widevine server.
3) A null pointer introduced when testing secure stops with an app
  id.  This has been fixed by directly injecting the app id in the unit
  tests.
4) Flaky network connections.  The unit tests were requesting data
  from the server and were timing out after 3 seconds.  I changed that
  to 12 seconds.
5) The tests were searching for an end-of-line marker to find the GLS
  header in the license response message.  The end-of-line marker was
  present in a valid DRM message for almost 1% of the test cases.  This
  code  has been replaced by searching for the string "GLS/1" at the
  begining of the HTML body.

I also added test_printers.cpp that defines functions used by GTest to
print error codes by name instead of numeric value.

This CL changes unit tests only. It does not change any production
code.

bug: 18316036

Change-Id: I3398580059a03114e782ac7ac59e6b0944012df4
2014-11-12 13:57:03 -08:00

65 lines
1.6 KiB
Makefile

# -------------------------------------------------------------------
# Makes a unit or end to end test.
# test_name must be passed in as the base filename(without the .cpp).
#
$(call assert-not-null,test_name)
include $(CLEAR_VARS)
LOCAL_MODULE := $(test_name)
LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := \
$(test_src_dir)/$(test_name).cpp \
../core/test/config_test_env.cpp \
../core/test/http_socket.cpp \
../core/test/license_request.cpp \
../core/test/test_printers.cpp \
../core/test/url_request.cpp
LOCAL_C_INCLUDES := \
bionic \
external/gtest/include \
external/openssl/include \
external/stlport/stlport \
vendor/widevine/libwvdrmengine/android/cdm/test \
vendor/widevine/libwvdrmengine/cdm/core/include \
vendor/widevine/libwvdrmengine/cdm/core/test \
vendor/widevine/libwvdrmengine/cdm/include \
vendor/widevine/libwvdrmengine/oemcrypto/include \
vendor/widevine/libwvdrmengine/test/gmock/include
LOCAL_C_INCLUDES += external/protobuf/src
LOCAL_ADDITIONAL_DEPENDENCIES := $(cdm_proto_gen_headers)
LOCAL_STATIC_LIBRARIES := \
libcdm \
libcdm_protos \
libgmock \
libgtest \
libgtest_main \
libwvlevel3 \
libcdm_utils \
libprotobuf-cpp-2.3.0-lite
LOCAL_SHARED_LIBRARIES := \
libcrypto \
libcutils \
libdl \
liblog \
libssl \
libstlport \
libutils
LOCAL_CFLAGS += -DUNIT_TEST
# Needed to use gMock 1.7.0 on Android
LOCAL_CFLAGS += \
-DGTEST_HAS_TR1_TUPLE \
-DGTEST_USE_OWN_TR1_TUPLE \
LOCAL_MODULE_TARGET_ARCH := arm mips x86
include $(BUILD_EXECUTABLE)