Skip to content

Commit

Permalink
Add tests to assert no exceptions are thrown when there are no callba…
Browse files Browse the repository at this point in the history
…cks.
  • Loading branch information
ksoichiro committed Nov 29, 2015
1 parent 6ce5204 commit 145c63d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ public void run() {
getInstrumentation().waitForIdleSync();
}

public void testNoCallbacks() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
scrollable = (ObservableGridView) activity.findViewById(R.id.scrollable);
scrollable.setScrollViewCallbacks(null);
}
});
testScroll();
}

public void testCallbacks() throws Throwable {
final ObservableScrollViewCallbacks[] callbacks = new ObservableScrollViewCallbacks[2];
callbackCounter[0] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public void run() {
getInstrumentation().waitForIdleSync();
}

public void testNoCallbacks() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
scrollable = (ObservableListView) activity.findViewById(R.id.scrollable);
scrollable.setScrollViewCallbacks(null);
}
});
testScroll();
}

public void testCallbacks() throws Throwable {
final ObservableScrollViewCallbacks[] callbacks = new ObservableScrollViewCallbacks[2];
callbackCounter[0] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ public void run() {
getInstrumentation().waitForIdleSync();
}

public void testNoCallbacks() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
scrollable = (ObservableRecyclerView) activity.findViewById(R.id.scrollable);
scrollable.setScrollViewCallbacks(null);
}
});
testScroll();
}

public void testCallbacks() throws Throwable {
final ObservableScrollViewCallbacks[] callbacks = new ObservableScrollViewCallbacks[2];
callbackCounter[0] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ public void testSaveAndRestoreInstanceState() throws Throwable {
testScroll();
}

public void testNoCallbacks() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
scrollable = (ObservableScrollView) activity.findViewById(R.id.scrollable);
scrollable.setScrollViewCallbacks(null);
}
});
testScroll();
}

public void testCallbacks() throws Throwable {
final ObservableScrollViewCallbacks[] callbacks = new ObservableScrollViewCallbacks[2];
callbackCounter[0] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ public void run() {
getInstrumentation().waitForIdleSync();
}

public void testNoCallbacks() throws Throwable {
runTestOnUiThread(new Runnable() {
@Override
public void run() {
scrollable = (ObservableWebView) activity.findViewById(R.id.scrollable);
scrollable.setScrollViewCallbacks(null);
}
});
testScroll();
}

public void testCallbacks() throws Throwable {
final ObservableScrollViewCallbacks[] callbacks = new ObservableScrollViewCallbacks[2];
callbackCounter[0] = 0;
Expand Down

0 comments on commit 145c63d

Please sign in to comment.