Merge "Fixing broken logging of OTHER events" into pi-dev
This commit is contained in:
@@ -348,6 +348,7 @@ public final class SelectionEvent implements Parcelable {
|
||||
case SelectionEvent.ACTION_ABANDON: // fall through
|
||||
case SelectionEvent.ACTION_SELECT_ALL: // fall through
|
||||
case SelectionEvent.ACTION_RESET: // fall through
|
||||
case SelectionEvent.ACTION_OTHER: // fall through
|
||||
return;
|
||||
default:
|
||||
throw new IllegalArgumentException(
|
||||
@@ -653,4 +654,4 @@ public final class SelectionEvent implements Parcelable {
|
||||
return new SelectionEvent[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,31 @@ import org.junit.runner.RunWith;
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class SelectionEventTest {
|
||||
|
||||
@Test
|
||||
public void testCreateSelectionActionEvent_valid() {
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_OVERTYPE);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_COPY);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_PASTE);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_CUT);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SHARE);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SMART_SHARE);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_DRAG);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_ABANDON);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_OTHER);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_SELECT_ALL);
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.ACTION_RESET);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testCreateSelectionActionEvent_badRange() {
|
||||
SelectionEvent.createSelectionActionEvent(0, -1, SelectionEvent.ACTION_OVERTYPE);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testCreateSelectionActionEvent_badAction() {
|
||||
SelectionEvent.createSelectionActionEvent(0, 1, SelectionEvent.EVENT_SELECTION_STARTED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParcel() {
|
||||
final SelectionEvent event = SelectionEvent.createSelectionStartedEvent(
|
||||
|
||||
Reference in New Issue
Block a user