Merge "Add test cases for highlight Preference click behavior"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ae9c414092
@@ -23,6 +23,7 @@ import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -140,7 +141,8 @@ public class TopLevelHighlightMixin implements Parcelable, DialogInterface.OnSho
|
||||
}
|
||||
}
|
||||
|
||||
String getHighlightPreferenceKey() {
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
|
||||
public String getHighlightPreferenceKey() {
|
||||
return mCurrentKey;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
@@ -72,6 +73,13 @@ public class TopLevelSettings extends DashboardFragment implements SplitLayoutLi
|
||||
setArguments(args);
|
||||
}
|
||||
|
||||
/** Dependency injection ctor only for testing. */
|
||||
@VisibleForTesting
|
||||
public TopLevelSettings(TopLevelHighlightMixin highlightMixin) {
|
||||
this();
|
||||
mHighlightMixin = highlightMixin;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.top_level_settings;
|
||||
|
||||
Reference in New Issue
Block a user