Merge "Move Panel to public API"
This commit is contained in:
committed by
Android (Google) Code Review
commit
7fa8e3131d
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
*/
|
||||
public class FakePanelContent implements PanelContent {
|
||||
|
||||
public static final String FAKE_KEY = "fake_key";
|
||||
public static final String FAKE_ACTION = "fake_action";
|
||||
|
||||
public static final CharSequence TITLE = "title";
|
||||
|
||||
|
@@ -27,8 +27,7 @@ public class FakeSettingsPanelActivity extends SettingsPanelActivity {
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
final Intent intent = new Intent();
|
||||
intent.putExtra(SettingsPanelActivity.EXTRA_PANEL_TYPE, FakePanelContent.FAKE_KEY);
|
||||
final Intent intent = new Intent(FakePanelContent.FAKE_ACTION);
|
||||
return intent;
|
||||
}
|
||||
}
|
@@ -20,6 +20,7 @@ package com.android.settings.panel;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -43,8 +44,16 @@ public class PanelFeatureProviderImplTest {
|
||||
@Test
|
||||
public void getPanel_internetConnectivityKey_returnsCorrectPanel() {
|
||||
final PanelContent panel = mProvider.getPanel(mContext,
|
||||
SettingsPanelActivity.PANEL_TYPE_WIFI);
|
||||
Settings.Panel.ACTION_INTERNET_CONNECTIVITY);
|
||||
|
||||
assertThat(panel).isInstanceOf(InternetConnectivityPanel.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getPanel_volume_returnsCorrectPanel() {
|
||||
final PanelContent panel = mProvider.getPanel(mContext,
|
||||
Settings.Panel.ACTION_VOLUME);
|
||||
|
||||
assertThat(panel).isInstanceOf(VolumePanel.class);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user