Files
app_Settings/tests/robotests/src/com/android/settings/enterprise/PrivacySettingsFinancedPreferenceTest.java
Tsung-Mao Fang aa19771a37 Ignore/Fix broken tests
Fix: 214943221
Fix: 215070875
Bug: 215071960
Bug: 215071948
Bug: 215072120
Test: run robo test
Change-Id: Id11c8461a2cb11cba96feebbfb0337b096eb3a17
2022-01-18 17:39:24 +08:00

70 lines
2.3 KiB
Java

/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.enterprise;
import static com.google.common.truth.Truth.assertThat;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.util.List;
@RunWith(RobolectricTestRunner.class)
public class PrivacySettingsFinancedPreferenceTest extends AbsBasePrivacySettingsPreference {
private Context mContext;
private PrivacySettingsFinancedPreference mPrivacySettingsFinancedPreference;
@Before
public void setUp() {
mContext = ApplicationProvider.getApplicationContext();
mPrivacySettingsFinancedPreference = new PrivacySettingsFinancedPreference(mContext);
}
@Test
public void getPreferenceScreenResId() {
assertThat(mPrivacySettingsFinancedPreference.getPreferenceScreenResId())
.isEqualTo(R.xml.financed_privacy_settings);
}
@Test
public void getXmlResourcesToIndex() {
final List<SearchIndexableResource> searchIndexableResources =
mPrivacySettingsFinancedPreference.getXmlResourcesToIndex();
verifyFinancedSearchIndexableResources(searchIndexableResources);
}
@Test
public void getPreferenceControllers() {
final List<AbstractPreferenceController> controllers =
mPrivacySettingsFinancedPreference.createPreferenceControllers(true);
verifyFinancedPreferenceControllers(controllers);
}
}