Skip to content

Commit

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

Change-Id: I0e2c4fb37e3a83a1eb2a5befc0c92be57f89ff53
  • Loading branch information
Sundong Ahn authored and android-build-merger committed Aug 14, 2019
2 parents b279c8c + b9df2ec commit 16dadd0
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 16dadd0

Please sign in to comment.