use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project platform_frameworks_base by android.
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 platform_frameworks_base by android.
the class MultiSelectManagerTest method testProvisionalSelection.
public void testProvisionalSelection() {
Selection s = mManager.getSelection();
assertSelection();
SparseBooleanArray provisional = new SparseBooleanArray();
provisional.append(1, true);
provisional.append(2, true);
s.setProvisionalSelection(getItemIds(provisional));
assertSelection(items.get(1), items.get(2));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project platform_frameworks_base by android.
the class MultiSelectManagerTest method assertSelectionSize.
private void assertSelectionSize(int expected) {
Selection selection = mManager.getSelection();
assertEquals(selection.toString(), expected, selection.size());
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project platform_frameworks_base by android.
the class MultiSelectManager_SelectionTest method testIntersection_all.
public void testIntersection_all() {
String[] ids0 = new String[] { "foo", "bar", "baz" };
String[] ids1 = new String[] { "0", "baz", "1", "foo", "2", "bar" };
Selection testSelection = new Selection();
testSelection.add(ids0[0]);
testSelection.add(ids0[1]);
testSelection.add(ids0[2]);
Selection control = new Selection();
control.copyFrom(testSelection);
testSelection.intersect(Sets.newHashSet(ids1));
assertTrue(testSelection.equals(control));
}
use of com.android.documentsui.dirlist.MultiSelectManager.Selection in project platform_frameworks_base by android.
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());
}
Aggregations