use of com.android.settings.deviceinfo.StorageItemPreference in project android_packages_apps_Settings by omnirom.
the class StorageItemPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mFragment.getActivity()).thenReturn(mActivity);
when(mFragment.getFragmentManager()).thenReturn(mFragmentManager);
when(mFragmentManager.beginTransaction()).thenReturn(mFragmentTransaction);
mContext = spy(RuntimeEnvironment.application.getApplicationContext());
mVolume = spy(new VolumeInfo("id", 0, null, "id"));
// Note: null is passed as the Lifecycle because we are handling it outside of the normal
// Settings fragment lifecycle for test purposes.
mController = new StorageItemPreferenceController(mContext, mFragment, mVolume, mSvp, false);
mPreference = new StorageItemPreference(mContext);
// Inflate the preference and the widget.
final LayoutInflater inflater = LayoutInflater.from(mContext);
inflater.inflate(mPreference.getLayoutResource(), new LinearLayout(mContext), false);
mPreferenceScreen = getPreferenceScreen();
}
Aggregations