Apply LightActionBar theme to Settings app.

Bug: 33558692
Test: visual
Test: RunSettingsRoboTests
Change-Id: I9f0fb71eb0cd0c58ac3b0f69544adec963faf2dd
This commit is contained in:
Fan Zhang
2016-12-15 14:22:31 -08:00
parent 0f23bfcd7e
commit e96b5b9faa
8 changed files with 51 additions and 23 deletions

View File

@@ -15,9 +15,9 @@
*/
package com.android.settings;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import org.junit.runners.model.InitializationError;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
@@ -55,10 +55,10 @@ public class SettingsRobolectricTestRunner extends RobolectricTestRunner {
// Using the manifest file's relative path, we can figure out the application directory.
final String appRoot = "packages/apps/Settings";
final String manifestPath = appRoot + "/AndroidManifest.xml";
final String resDir = appRoot + "/res";
final String resDir = appRoot + "/tests/robotests/res";
final String assetsDir = appRoot + config.assetDir();
// By adding any resources from libraries we need to the AndroidManifest, we can access
// By adding any resources from libraries we need the AndroidManifest, we can access
// them from within the parallel universe's resource loader.
final AndroidManifest manifest = new AndroidManifest(Fs.fileFromPath(manifestPath),
Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) {

View File

@@ -18,37 +18,37 @@ package com.android.settings.dashboard;
import android.accounts.Account;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import com.android.settings.R;
import com.android.settings.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.dashboard.SupportItemAdapter.EscalationData;
import com.android.settings.overlay.SupportFeatureProvider;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import com.android.settings.R;
import org.robolectric.shadows.ShadowActivity;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.verify;
import static org.robolectric.Shadows.shadowOf;
import static org.mockito.Mockito.when;
import static com.google.common.truth.Truth.assertThat;
import static org.robolectric.Shadows.shadowOf;
@RunWith(RobolectricTestRunner.class)
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class SupportItemAdapterTest {
private static final String ACCOUNT_TYPE = "com.google";
@@ -106,9 +106,10 @@ public class SupportItemAdapterTest {
@Test
public void testSetAccount_AccountEmpty_NotCrash() {
when(mSupportFeatureProvider.getSupportEligibleAccounts(mActivity)).thenReturn(ZERO_ACCOUNT);
when(mSupportFeatureProvider.getSupportEligibleAccounts(mActivity)).thenReturn(
ZERO_ACCOUNT);
mSupportItemAdapter = new SupportItemAdapter(mActivity, null, mSupportFeatureProvider,
mMetricsFeatureProvider, null);
mMetricsFeatureProvider, null);
// Should not crash in this method
mSupportItemAdapter.setAccounts(ONE_ACCOUNT);