Skip to content

Commit

Permalink
* test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Beloo authored and Beloo committed Dec 30, 2016
1 parent 784f1db commit 518c668
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.beloo.widget.chipslayoutmanager;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
Expand Down Expand Up @@ -86,7 +87,7 @@ public RecyclerView.LayoutManager layoutManager(Context context) {
activity.runOnUiThread(() -> activity.initialize());
}

private IScrollingContract retrieveLayoutManager() {
private RecyclerView.LayoutManager retrieveLayoutManager() {
this.layoutManager = getLayoutManager();
return layoutManager;
}
Expand Down Expand Up @@ -310,6 +311,13 @@ public void rotate_LMHasItems_firstItemNotChanged() throws Exception {
assertNotEquals(-1, actual);
assertEquals("first visible positions before and after rotation doesn't match", expected, actual);
System.out.println("first visible position = " + actual);

resetToInitialAfterRotate();
}

void resetToInitialAfterRotate() throws Exception {
activityTestRule.launchActivity(new Intent(activity, TestActivity.class));
InstrumentalUtil.waitForIdle();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public RecyclerView.LayoutManager layoutManager(Context context) {

public void onSetUp() throws Exception {}

private IScrollingContract retrieveLayoutManager() {
private RecyclerView.LayoutManager retrieveLayoutManager() {
layoutManager = getLayoutManager();
return layoutManager;
}
Expand Down

0 comments on commit 518c668

Please sign in to comment.