Loading src/com/android/documentsui/BaseActivity.java +0 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import android.widget.Toolbar; import com.android.documentsui.AbstractActionHandler.CommonAddons; import com.android.documentsui.Injector.Injected; import com.android.documentsui.NavigationViewManager.Breadcrumb; import com.android.documentsui.archives.ArchivesProvider; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.Shared; Loading @@ -65,7 +64,6 @@ import com.android.documentsui.sidebar.RootsFragment; import com.android.documentsui.sorting.SortController; import com.android.documentsui.sorting.SortModel; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Date; import java.util.List; Loading tests/unit/com/android/documentsui/files/ActionHandlerTest.java +29 −0 Original line number Diff line number Diff line Loading @@ -517,6 +517,35 @@ public class ActionHandlerTest { mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); } @Test public void testAuthentication() throws Exception { PendingIntent intent = PendingIntent.getActivity( InstrumentationRegistry.getInstrumentation().getTargetContext(), 0, new Intent(), 0); mHandler.startAuthentication(intent); assertEquals(intent.getIntentSender(), mActivity.startIntentSender.getLastValue().first); assertEquals(AbstractActionHandler.CODE_AUTHENTICATION, mActivity.startIntentSender.getLastValue().second.intValue()); } @Test public void testOnActivityResult_onOK() throws Exception { mHandler.onActivityResult(AbstractActionHandler.CODE_AUTHENTICATION, Activity.RESULT_OK, null); mActivity.refreshCurrentRootAndDirectory.assertCalled(); } @Test public void testOnActivityResult_onNotOK() throws Exception { mHandler.onActivityResult(0, Activity.RESULT_OK, null); mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); mHandler.onActivityResult(AbstractActionHandler.CODE_AUTHENTICATION, Activity.RESULT_CANCELED, null); mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); } private void assertRootPicked(Uri expectedUri) throws Exception { mEnv.beforeAsserts(); Loading Loading
src/com/android/documentsui/BaseActivity.java +0 −2 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import android.widget.Toolbar; import com.android.documentsui.AbstractActionHandler.CommonAddons; import com.android.documentsui.Injector.Injected; import com.android.documentsui.NavigationViewManager.Breadcrumb; import com.android.documentsui.archives.ArchivesProvider; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.Shared; Loading @@ -65,7 +64,6 @@ import com.android.documentsui.sidebar.RootsFragment; import com.android.documentsui.sorting.SortController; import com.android.documentsui.sorting.SortModel; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Date; import java.util.List; Loading
tests/unit/com/android/documentsui/files/ActionHandlerTest.java +29 −0 Original line number Diff line number Diff line Loading @@ -517,6 +517,35 @@ public class ActionHandlerTest { mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); } @Test public void testAuthentication() throws Exception { PendingIntent intent = PendingIntent.getActivity( InstrumentationRegistry.getInstrumentation().getTargetContext(), 0, new Intent(), 0); mHandler.startAuthentication(intent); assertEquals(intent.getIntentSender(), mActivity.startIntentSender.getLastValue().first); assertEquals(AbstractActionHandler.CODE_AUTHENTICATION, mActivity.startIntentSender.getLastValue().second.intValue()); } @Test public void testOnActivityResult_onOK() throws Exception { mHandler.onActivityResult(AbstractActionHandler.CODE_AUTHENTICATION, Activity.RESULT_OK, null); mActivity.refreshCurrentRootAndDirectory.assertCalled(); } @Test public void testOnActivityResult_onNotOK() throws Exception { mHandler.onActivityResult(0, Activity.RESULT_OK, null); mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); mHandler.onActivityResult(AbstractActionHandler.CODE_AUTHENTICATION, Activity.RESULT_CANCELED, null); mActivity.refreshCurrentRootAndDirectory.assertNotCalled(); } private void assertRootPicked(Uri expectedUri) throws Exception { mEnv.beforeAsserts(); Loading