Skip to content

Commit

Permalink
Merge "Check the media.settings.xml property" into qt-dev am: b9df2ec
Browse files Browse the repository at this point in the history
am: 16dadd0

Change-Id: I1d6598f7cbc30bdccab547194c3cde628fc7b320
  • Loading branch information
Sundong Ahn authored and android-build-merger committed Aug 14, 2019
2 parents 2468cb0 + 16dadd0 commit d2cd628
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions media/libmedia/xsd/vts/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cc_test {
"libxml2",
],
shared_libs: [
"libbase",
"liblog",
],
cflags: [
Expand Down
12 changes: 10 additions & 2 deletions media/libmedia/xsd/vts/ValidateMediaProfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@
* limitations under the License.
*/

#include <string>

#include <android-base/file.h>
#include <android-base/properties.h>
#include "utility/ValidateXml.h"

TEST(CheckConfig, mediaProfilesValidation) {
RecordProperty("description",
"Verify that the media profiles file "
"is valid according to the schema");

const char* location = "/vendor/etc";
std::string mediaSettingsPath = android::base::GetProperty("media.settings.xml", "");
if (mediaSettingsPath.empty()) {
mediaSettingsPath.assign("/vendor/etc/media_profiles_V1_0.xml");
}

EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS("media_profiles_V1_0.xml", {location},
EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(android::base::Basename(mediaSettingsPath).c_str(),
{android::base::Dirname(mediaSettingsPath).c_str()},
"/data/local/tmp/media_profiles.xsd");
}

0 comments on commit d2cd628

Please sign in to comment.