use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.
the class MultiSelectManagerTest method testProvisionalSelection_IntersectsExistingProvisionalSelection.
public void testProvisionalSelection_IntersectsExistingProvisionalSelection() {
Selection s = mManager.getSelection();
SparseBooleanArray provisional = new SparseBooleanArray();
provisional.append(1, true);
provisional.append(2, true);
s.setProvisionalSelection(getItemIds(provisional));
provisional.clear();
provisional.append(1, true);
s.setProvisionalSelection(getItemIds(provisional));
assertSelection(items.get(1));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.
the class MultiSelectManagerTest method assertSelected.
private void assertSelected(String... expected) {
for (int i = 0; i < expected.length; i++) {
Selection selection = mManager.getSelection();
String err = String.format("Selection %s does not contain %s", selection, expected[i]);
assertTrue(err, selection.contains(expected[i]));
}
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.
the class MultiSelectManager_SelectionTest method testIntersection_exclusive.
public void testIntersection_exclusive() {
String[] ids0 = new String[] { "foo", "bar", "baz" };
String[] ids1 = new String[] { "0", "1", "2" };
Selection testSelection = new Selection();
testSelection.add(ids0[0]);
testSelection.add(ids0[1]);
testSelection.add(ids0[2]);
Set<String> set = Sets.newHashSet(ids1);
testSelection.intersect(set);
assertTrue(testSelection.isEmpty());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.
the class MultiSelectManager_SelectionTest method testEqualsOther.
public void testEqualsOther() {
Selection other = new Selection();
other.add(ids[0]);
other.add(ids[1]);
other.add(ids[2]);
assertEquals(selection, other);
assertEquals(selection.hashCode(), other.hashCode());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project android_frameworks_base by DirtyUnicorns.
the class MultiSelectManager_SelectionTest method testIntersection_empty1.
public void testIntersection_empty1() {
Selection testSelection = new Selection();
testSelection.intersect(Sets.newHashSet("foo"));
assertTrue(testSelection.isEmpty());
}
Aggregations