Fix AccessibilityButtonFragmentTest
**Root cause** We expected the spy resources will be used when calling context.getResources(). However, we didn't set up the connection. Hence the test failed due to trying to use the original resources. Bug: 279082331 Test: atest AccessibilityButtonFragmentTest Change-Id: Ib6e51b2b2607bec7980b9288a0a8076e4a036863
This commit is contained in:
@@ -67,6 +67,7 @@ public class AccessibilityButtonFragmentTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
mFragment = spy(new TestAccessibilityButtonFragment(mContext));
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
when(mFragment.getResources()).thenReturn(mResources);
|
||||
when(mFragment.getActivity()).thenReturn(Robolectric.setupActivity(FragmentActivity.class));
|
||||
}
|
||||
|
Reference in New Issue
Block a user