blob: 7729d52fe16426fd618f6baa6d9912eb96e7a70f [file] [log] [blame]
Sundong Ahn76839442019-03-20 23:02:57 +09001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Sundong Ahnef8695e2019-07-30 20:43:43 +090017#include <string>
18
19#include <android-base/file.h>
20#include <android-base/properties.h>
Sundong Ahn76839442019-03-20 23:02:57 +090021#include "utility/ValidateXml.h"
22
23TEST(CheckConfig, mediaProfilesValidation) {
24 RecordProperty("description",
25 "Verify that the media profiles file "
26 "is valid according to the schema");
27
Sundong Ahnef8695e2019-07-30 20:43:43 +090028 std::string mediaSettingsPath = android::base::GetProperty("media.settings.xml", "");
29 if (mediaSettingsPath.empty()) {
30 mediaSettingsPath.assign("/vendor/etc/media_profiles_V1_0.xml");
31 }
Sundong Ahn76839442019-03-20 23:02:57 +090032
Sundong Ahnef8695e2019-07-30 20:43:43 +090033 EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(android::base::Basename(mediaSettingsPath).c_str(),
34 {android::base::Dirname(mediaSettingsPath).c_str()},
Sundong Ahn76839442019-03-20 23:02:57 +090035 "/data/local/tmp/media_profiles.xsd");
36}