instrument: fix DrawableMatcher for varying contexts

This commit is contained in:
Vincent Breitmoser 2015-06-20 22:32:55 +02:00
parent 675df57abd
commit 2a05e2a17b

View File

@ -102,7 +102,7 @@ public class DrawableMatcher extends TypeSafeMatcher<View> {
}
// if those are both bitmap drawables, compare their bitmaps (ignores color filters, which is what we want!)
if (mIgnoreFilters && drawable instanceof BitmapDrawable && expectedDrawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap().equals(((BitmapDrawable) expectedDrawable).getBitmap());
return ((BitmapDrawable) drawable).getBitmap().sameAs((((BitmapDrawable) expectedDrawable).getBitmap()));
}
return expectedDrawable.getConstantState().equals(drawable.getConstantState());
}