Restructure Media related tests to avoid duplicated code

Change-Id: I4428d38e0199b12255f3746e79f8093259a03da1
Merge "Restructure Media related tests to avoid duplicated code"