Sundong Ahn | 7683944 | 2019-03-20 23:02:57 +0900 | [diff] [blame] | 1 | /* |
| 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 Ahn | ef8695e | 2019-07-30 20:43:43 +0900 | [diff] [blame] | 17 | #include <string> |
| 18 | |
| 19 | #include <android-base/file.h> |
| 20 | #include <android-base/properties.h> |
Sundong Ahn | 7683944 | 2019-03-20 23:02:57 +0900 | [diff] [blame] | 21 | #include "utility/ValidateXml.h" |
| 22 | |
| 23 | TEST(CheckConfig, mediaProfilesValidation) { |
| 24 | RecordProperty("description", |
| 25 | "Verify that the media profiles file " |
| 26 | "is valid according to the schema"); |
| 27 | |
Sundong Ahn | ef8695e | 2019-07-30 20:43:43 +0900 | [diff] [blame] | 28 | 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 Ahn | 7683944 | 2019-03-20 23:02:57 +0900 | [diff] [blame] | 32 | |
Sundong Ahn | ef8695e | 2019-07-30 20:43:43 +0900 | [diff] [blame] | 33 | EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(android::base::Basename(mediaSettingsPath).c_str(), |
| 34 | {android::base::Dirname(mediaSettingsPath).c_str()}, |
Sundong Ahn | 7683944 | 2019-03-20 23:02:57 +0900 | [diff] [blame] | 35 | "/data/local/tmp/media_profiles.xsd"); |
| 36 | } |